/* General Styles */
body {
    background: linear-gradient(145deg, #1e1e1e, #252525);
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
	overflow-y: auto;
    transition: filter 0.3s ease;
}

body.loading .container {
    filter: blur(5px);
    pointer-events: none;
}

/* Container */
.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 30px;
    padding-bottom: 50px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    background: rgba(40, 40, 40, 0.95);
    border-radius: 12px;
    min-height: 80vh;
	margin-top: 20px;
    position: relative;
	overflow-y: auto;
}

/* Logo */
.logo {
    width: 100px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
}

/* Headings */
h1 {
    margin-bottom: 20px;
    font-size: 2em;
}

/* Forms and Inputs */
label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

input, textarea, select, button {
    background: linear-gradient(135deg, #333333, #3e3e3e);
    color: #f5f5f5;
    border: none;
    padding: 12px;
    margin-top: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

input, textarea {
    background: rgba(46, 46, 46, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input:focus, textarea:focus, select:focus {
    border: 1px solid #777;
    outline: none;
}

select {
    appearance: none;
    background: linear-gradient(135deg, #333333, #3e3e3e) no-repeat right 10px center;
    background-size: 12px;
}

option { 
    background: #1e1e1e; 
    color: #f5f5f5; 
}

button:hover, select:hover {
    background: linear-gradient(135deg, #444, #555);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.4);
}

button:disabled, select:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Specific Buttons */
#sendButton, #preFillButton {
    display: none;
}

#sendButton {
    margin: 20px auto 50px auto;
}


#preFillButton {
    display: none;
    padding: 8px;
    margin: 10px;
    font-size: 0.6rem;
	float: right;	
    width: fit-content;
	
}

#preFillButton:hover {
    background: linear-gradient(135deg, #444, #555);
}

/* Recipient Sections */
#templateDetails, #editSection {
    margin-top: 30px;
    text-align: left;
    background: rgba(35, 35, 35, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.recipient {
    margin-bottom: 20px;
    padding: 10px;
    border-bottom: 1px solid #555;
}

.recipient:last-child {
    border-bottom: none;
}

.recipient h3 {
    margin-bottom: 10px;
}

/* Others Group */
.others-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    cursor: help;
}

.otherRecipient {
    display: inline-block;
    margin-right: 8px;
    cursor: pointer;
}

.otherRecipient:hover { 
    opacity: 0.5; 
}

/* Help Button */
#helpButton {
    position: absolute;
    top: 20px;	
    left: 20px;
    background: rgba(50,50,50,0.5);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 8px;
	width: fit-content;		
    transition: background 0.3s ease, color 0.3s ease;
}

#helpButton:hover {
    background: rgba(50,50,50,0.7);
    color: #ffffff;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100vh;
	overflow-y: auto;
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
}

.modal-content {
    background-color: #2e2e2e;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border-radius: 12px;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 800px;
	max-height: 80vh;
	overflow-y: auto;
    position: relative;
}

.close-modal {
    color: #cccccc;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
	background: rgba(0,0,0,0.75);
	border-radius: 50%;
	box-shadow: 0px 0px 2px #999;
	min-width: 25px;
	text-align: center;
}

.close-modal:hover,
.close-modal:focus {
    color: #ffffff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.8);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #555, #777);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #666, #888);
}

/* Loading Indicator */
#loadingIndicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #f5f5f5;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 1002;
    display: flex;
    align-items: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

#loadingSpinner {
    width: 50px;
    height: 50px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #f5f5f5;
    border-radius: 50%;
    animation: professional-spin 1s linear infinite;
    margin-right: 15px;
}

/* Improved Spinner Animation */
@keyframes professional-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Class */
.loading {
    /* Removed duplicate blur effect */
}


/* Feedback Notifications */
#verboseFeedback, #errorMessage, #successMessage {
    position: fixed;	
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1003;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.9) !important;
    max-width: 300px;
    word-wrap: break-word;
    animation: fade-in 0.3s ease, fade-out 0.3s ease 7.7s;
    max-height: fit-content;
    height: fit-content;
}

#verboseFeedback {
    top: 20px;
    background: #333;
}

#errorMessage {
    bottom: 20px;
    background: #e74c3c;
}

#successMessage {
    bottom: 20px;
    background: #2ecc71;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Center Utility */
.center { 
    text-align: center; 
    margin: auto !important;  
}

#templateSelect { max-width: 90%; width: fit-content;	 font-size: 1rem; text-align: center; text-shadow: 0px 0px 2px black; 	}

input { max-width: 90%; min-width: 80%; }

.prefill-field {
    margin-bottom: 15px;
}

.prefill-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.prefill-field input[type="text"],
.prefill-field input[type="email"],
.prefill-field input[type="date"],
.prefill-field select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.prefill-field div input[type="radio"] {
    margin-right: 5px;
}

/* Hide the radio button itself */
input[type=radio] {
  display: none;
}

/* Label styling */
.radioLabel {
  display: inline-block !important;
  width: 30%;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  background-color: rgba(0,0,0,0.1); /* Default background color */
  transition: background-color 0.3s ease;
}

/* Change label background when the radio button is checked */
input[type=radio]:checked + .radioLabel {
  background-color: rgba(0,0,0,0.9); /* Background color when selected */
  box-shadow: 0px 0px 4px white;
  border: 1px solid black;
  border-radius: 10px;
  border: 1px solid white;
  
}

.formSubgroup {
    border: 1px solid #ccc;
    padding: 1em;
    margin-bottom: 1.5em;
	box-shadow: 0px 0px 2px black;		
    border-radius: 5px;
    background-color: rgba(0,0,0,0.4);
}

.formSubgroup legend {
    font-weight: bold;
    padding: 0 0.5em;
    color: #efefef;
}

/* Style for the pseudo button */
.pseudo-button {
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}