:root {
	--primary-color: #2f7f63;
	--secondary-color: #3a9d7c;
	--accent-color: #e74c3c;
	--light-color: #f8f9fa;
	--dark-color: #343a40;
	--border-color: #dee2e6;
	--success-color: #28a745;
	--warning-color: #ce9b00;
	--danger-color: #dc3545;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Tajawal', sans-serif;
}

html[dir="ltr"] .remove-companion {
    right: 15px;
    left: unset;
}
html[dir="ltr"] #current-time {
    left: unset;
    right: 20px;
}
html[dir="ltr"] .header h1 {
    text-align: left;
}

html[data-theme="sad"] .qr-section {
    background: #f7f0f0;
}
html[data-theme="sad"] .qr-placeholder {
    background: #faf8f8;
}
html[data-theme="sad"] .add-companion {
    background: rgb(127 47 47 / 10%);
}
html[data-theme="sad"] .add-companion:hover {
    background: rgb(127 47 47 / 20%);
}

html[lang="en"] .radio-option input {
    margin-left: unset;
    margin-right: 8px;
}

body {
	background-color: #f5f7fa;
	color: #333;
	line-height: 1.6;
	min-height: 100vh;
}

.container {
	max-width: 1200px;
	margin: 50px auto;
	background: white;
	border-radius: 12px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.header {
	background: linear-gradient(135deg, var(--primary), var(--success));
	color: white;
	padding: 30px 40px;
	text-align: center;
	position: relative;
}

.header h1 {
	font-size: 28px;
	margin-bottom: 10px;
	font-weight: 700;
	text-align: right;
}

.current-time {
	position: absolute;
	top: 20px;
	left: 20px;
	background: rgba(255, 255, 255, 0.2);
	padding: 8px 15px;
	border-radius: 20px;
	font-size: 14px;
	min-width: 150px;
}

.content {
	display: flex;
	min-height: 600px;
}

.registration-section {
	flex: 1;
	padding: 30px 40px;
	border-right: 1px solid var(--border-color);
}

.qr-section {
	width: 400px;
	background: #f0f7f4;
	padding: 30px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.form-title {
	color: var(--primary);
	font-size: 24px;
	margin-bottom: 25px;
	padding-bottom: 15px;
	border-bottom: 2px solid var(--border-color);
}

.required-note {
	margin-bottom: 20px;
	color: #666;
	font-size: 14px;
}

.required-note span {
	color: var(--accent-color);
}

.form-group {
	margin-bottom: 20px;
}

.form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: var(--dark-color);
}

.english-label {
	font-size: 12px;
	color: #777;
	font-weight: normal;
}

.radio-group {
	display: flex;
	gap: 15px;
}

.radio-option {
	display: flex;
	align-items: center;
	padding: 10px 15px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background: white;
	cursor: pointer;
	transition: all 0.2s;
	flex: 1;
}

.radio-option.selected {
	border-color: var(--primary);
	background-color: rgba(47, 127, 99, 0.1);
}

.radio-option input {
	margin-left: 8px;
}

.form-input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-size: 16px;
	transition: border-color 0.3s;
}

.form-input:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(47, 127, 99, 0.1);
}

.day-container {
	margin-bottom: 25px;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 15px;
}

.day-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--primary);
	margin-bottom: 15px;
}

.time-slot-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.time-slot {
	padding: 12px;
	border: 1px solid #aeb5bc;
	border-radius: 8px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
	background: white;
	position: relative;
}

.time-slot.selected {
	border-color: var(--primary);
	background-color: rgba(47, 127, 99, 0.1);
}

.time-slot.disabled {
	background-color: #f8f9fa;
	color: #adb5bd;
	cursor: not-allowed;
	position: relative;
}

.time-slot.disabled::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
}

.time-slot.low-capacity {
	border-color: var(--warning-color);
	background-color: rgba(255, 193, 7, 0.1);
}

.time-slot .status {
	font-size: 12px;
	margin-top: 5px;
	font-weight: 500;
}

.time-slot .remaining {
	font-size: 11px;
	color: var(--warning-color);
	margin-top: 3px;
}

.time-slot.available .status {
	color: var(--success-color);
}

.time-slot.upcoming .status {
	color: var(--warning-color);
}

.time-slot.past .status {
	color: var(--danger-color);
}

.time-slot:hover:not(.disabled) {
	border: 1px solid green;
	background: #eaeaea;
}

.time-slot.upcoming:hover {
	border-style: solid;
}

.companion-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 30px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border-color);
}

.add-companion {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: rgba(47, 127, 99, 0.1);
	color: var(--primary);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s;
	margin-top: 15px;
}

.add-companion:hover {
	background: rgba(47, 127, 99, 0.2);
}

.companion-form {
	background: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
	margin-top: 15px;
	position: relative;
}

.remove-companion {
	position: absolute;
	top: 15px;
	left: 15px;
	background: var(--danger-color);
	color: white;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	font-weight: bold;
}

.captcha-container {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: 10px;
}

.captcha-img {
	border: 1px solid var(--border-color);
	border-radius: 6px;
	padding: 5px;
	background: white;
}

.submit-btn {
	display: block;
	width: 100%;
	padding: 15px;
	background: var(--primary);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s;
	margin-top: 25px;
}

.submit-btn:hover {
	background: var(--success);
	transform: translateY(-2px);
}

.qr-container {
	width: 100%;
	max-width: 300px;
	margin: 20px 0;
	padding: 15px;
	background: white;
	border-radius: 10px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	text-align: center;
}

.qr-title {
	font-weight: 700;
	color: var(--primary);
	margin: 10px 0;
}

.qr-placeholder {
width: 100%;
    height: 250px;
    background: #f8f9fa;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-weight: 500;
    display: grid;
    text-align: center;
}

.qr-result {
	display: none;
	flex-direction: column;
	align-items: center;
	padding: 20px;
}

.qr-codes-container {
/*	display: flex;	*/
	flex-wrap: wrap;
	gap: 20px;
	justify-content: center;
	margin-top: 20px;
}

.qr-card {
	background: white;
	border-radius: 10px;
	padding: 15px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	text-align: center;
	width: 200px;
    margin: auto;
}

.qr-name {
	font-weight: 700;
	margin: 10px 0;
	color: var(--dark-color);
}

.qr-code-img {
	width: 150px;
	height: 150px;
	margin: 0 auto;
	background: #f8f9fa;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qr-code-value {
	font-size: 12px;
	color: #666;
	word-break: break-all;
	margin-top: 10px;
}

@media (max-width: 900px) {
	.content {
		flex-direction: column;
	}
	
	.registration-section {
		border-right: none;
		border-bottom: 1px solid var(--border-color);
	}
	
	.qr-section {
		width: 100%;
	}
}

@media (max-width: 1060px) {
	#current-time {
		position: initial;
		max-width: 210px;
		margin: auto;
	}

	.header h1 {
		text-align: center;
	}
}

@media (max-width: 600px) {
	.radio-group {
		flex-direction: column;
	}
	
	.header, .registration-section {
		padding: 20px;
	}
	
	.time-slot-container {
		grid-template-columns: 1fr 1fr;
	}
	
	.header h1 {
		font-size: 22px;
	}
}


.time-slot {
	/* استایل پایه */
	cursor: pointer;
	transition: all 0.2s;
}

.time-slot.selected {
	border: 1px solid #2f7f63;
	background-color: rgb(47 127 99 / 15%);
	border-style: solid !important;
}

.time-slot.disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.time-slot.upcoming:not(.disabled) {
	border: 1px dashed #ce9b00;
}

.time-slot.available .status {
	color: #28a745;
}

.time-slot.upcoming .status {
	color: #ce9b00;
}

.time-slot.past .status {
	color: #dc3545;
}

.error-input {
	border: 1px solid red !important;
}

.error-message {
	display: block;
	color: red;
	margin-top: 5px;
}

.required-field {
	border: 1px solid #ff9800;
}

.time-slot.full {
	background-color: #ffeeee;
	border-color: #ffcccc;
	color: #cc0000;
}

.time-slot.full .status {
	color: #cc0000;
}

.time-slot.full.disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.time-slot.full.disabled::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
}

.full-message {
	font-size: 12px;
	color: #cc0000;
	margin-top: 5px;
	font-weight: bold;
}



/* استایل بخش شرایط ثبت نام */
.registration-conditions {
    padding: 15px 40px;
}
.registration-conditions.has-content {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.registration-conditions.has-content h2 {
    color: #343a40;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.registration-conditions.has-content .conditions-content {
    line-height: 1.6;
}

/* استایل بخش اطلاعات بعد از ثبت نام */
#after-registration-info.has-content .after-registration-content {
    border-radius: 5px;
    padding: 20px;
}

/* استایل بخش اطلاعات بعد از ثبت نام */
#after-registration-info.has-content {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 30px;
	width: 100%;
}

#after-registration-info.has-content .after-registration-content h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.has-content .info-content {
    line-height: 1.8;
    color: #34495e;
}

.has-content .info-content ul {
    padding-left: 20px;
}

.has-content .info-content li {
    margin-bottom: 8px;
}

.time-slot.upcoming-day {
    border: 1px dashed #ce9b00;
    background-color: #fff9e6;
    cursor: default;
}

.time-slot.upcoming-day .status {
    color: #ce9b00;
    font-weight: bold;
}

.no-slots {
    text-align: center;
    padding: 15px;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.time-slot.upcoming-slot {
    border: 1px dashed #ce9b00;
    background-color: #fff9e6;
    cursor: not-allowed;
    opacity: 0.8;
}

.time-slot.upcoming-slot .status {
    color: #ce9b00;
    font-weight: bold;
}

.time-slot .activation-time {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.first_activation_time_alarm {
    color: #d84d12;
    font-weight: bold;
}

/* استایل مودال */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.retrieve-qr-link {
    margin-top: 15px;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.retrieve-qr-link:hover {
    color: #004499;
}

.qr-user-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}



/* استایل مودال پیشرفته */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    background-color: #f8f9fa;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 360px;
    position: relative;
    border: none;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #6c757d;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #343a40;
}

.modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

#retrieve-qr-form .form-group {
    margin-bottom: 20px;
}

#retrieve-qr-form label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

#retrieve-qr-form input[type="tel"],
#retrieve-qr-form input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#retrieve-qr-form input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

#retrieve-qr-form button[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    width: 100%;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

#retrieve-qr-form button[type="submit"]:hover {
    background-color: var(--success);
}

.retrieve-qr-link {
    display: inline-block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 14px;
    padding: 5px;
    border-radius: 4px;
}

.retrieve-qr-link:hover {
    color: #0056b3;
    background-color: #f8f9fa;
}

/* استایل کپچا */
#retrieve-qr-form .captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#retrieve-qr-form .captcha-img {
    border: 1px solid #ddd;
    border-radius: 4px;
}

#retrieve-qr-form #refresh-retrieve-captcha {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
}

#retrieve-qr-form #refresh-retrieve-captcha:hover {
    color: #343a40;
}


.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.custom-alert.success {
    background-color: #28a745;
}

.custom-alert.error {
    background-color: #dc3545;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#after-registration-info iframe {
    width: 100%;
    margin-top: 15px;
}