/* ===== استایل جامع ترکیب‌شده ===== */
/* نسخه نهایی منظم و یکپارچه */

/* -------------------- ریست و پایه -------------------- */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9eef3 100%);
    color: #1a2a3a;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* -------------------- سربرگ (header) -------------------- */
.header {
    background: linear-gradient(135deg, #8B0000 0%, #B22222 100%);
    color: #fff;
    padding: 30px 25px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 35px -5px rgba(139, 40, 40, .3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "⚕️";
    position: absolute;
    font-size: 150px;
    left: -20px;
    bottom: -40px;
    opacity: .1;
    transform: rotate(15deg);
    pointer-events: none;
}

.menu-icon {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;     /* fallback */
    background-color: rgba(255, 255, 255, 0.15);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .3s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .3);
    z-index: 10;
}

.menu-icon:hover {
    background-color: #fff;     /* fallback */
    background-color: rgba(255, 255, 255, 0.3);
}

.menu-icon a {
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #fff;
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: .95;
    color: #fff;
}

.header h3 {
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 15px;
    opacity: .9;
    color: #fff;
}

/* آیتم‌های اضافی فقط در b */
.admin-key {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #8B0000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
}

.admin-key:hover {
    background: #f0f0f0;
}

.welcome-message {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 1rem;
    background: rgba(0, 0, 0, .2);
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.menu-section {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    margin-bottom: 30px;
}

.menu-title {
    font-size: 1.5rem;
    color: #8B0000;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
}

.link-list li a {
    display: block;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    border-right: 4px solid #8B0000;
    transition: .2s;
}

.link-list li a:hover {
    background: #ffe6e6;
    transform: translateX(-2px);
}

/* -------------------- کادر متن (hero-quote) -------------------- */
.hero-quote {
    background: linear-gradient(145deg, #fff 0%, #fcf9f7 100%);
    border-radius: 30px;
    padding: 35px 45px;
    box-shadow: 0 15px 30px -10px rgba(139, 0, 0, .15), 0 0 0 1px rgba(139, 0, 0, .05) inset;
    border-right: 6px solid #8B0000;
    position: relative;
    transition: all .3s ease;
}

.hero-quote:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 40px -15px rgba(139, 0, 0, .2), 0 0 0 1px rgba(139, 0, 0, .1) inset;
}

.quote-icon {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 40px;
    color: rgba(139, 0, 0, .1);
    z-index: 1;
}

.quote-icon.left {
    left: 25px;
    right: auto;
    transform: rotate(180deg);
}

.hero-text {
    position: relative;
    z-index: 2;
    font-size: 1rem;
    line-height: 2;
    color: #2c3e50;
    text-align: justify;
}

.hero-text h3 {
    color: #8B0000;
    margin-bottom: 20px;
    font-size: 1.6rem;
    border-bottom: 2px solid rgba(139, 0, 0, .2);
    padding-bottom: 10px;
}

.hero-text h4 {
    color: #8B0000;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.hero-text ul,
.hero-text ol {
    margin-right: 25px;
    margin-bottom: 20px;
}

.hero-text li {
    margin-bottom: 5px;
}

.hero-text p {
    margin-bottom: 22px;
    font-weight: 350;
}

.hero-text p:first-child {
    font-size: 1.2rem;
    font-weight: 500;
    color: #8B0000;
    border-bottom: 1.5px solid rgba(139, 0, 0, .2);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.hero-text p:last-child {
    margin-bottom: 0;
}

.highlight {
    color: #8B0000;
    font-weight: 600;
    background: linear-gradient(120deg, rgba(139, 0, 0, .07) 0%, rgba(139, 0, 0, .12) 100%);
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
}

/* -------------------- جدول (فقط در a) -------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
}

th,
td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: right;
    vertical-align: top;
}

th {
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
}

td:first-child {
    text-align: center;
    font-weight: 500;
    background-color: #f8f9fa;
    width: 60px;
}

tr:hover {
    background-color: #f1f3f5;
}

/* -------------------- اسپویلر -------------------- */
.spoiler {
    background-color: gray;
    color: transparent;
    user-select: none;
}

.spoiler:hover {
    background-color: inherit;
    color: inherit;
}

/* -------------------- پیام‌ها -------------------- */
.message {
    padding: 15px 25px;
    border-radius: 50px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message i {
    font-size: 1.3rem;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 20px 0;
}

.info-message {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 12px;
    margin: 20px 0;
}

.error-box {
    background-color: #ffebee;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #ffcdd2;
    color: #b71c1c;
    font-weight: 500;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-link {
    text-align: center;
    margin-top: 25px;
    font-size: 1rem;
}

.register-link a {
    color: #8B0000;
    text-decoration: none;
    font-weight: 600;
    margin-right: 5px;
}

.register-link a:hover {
    text-decoration: underline;
}

/* -------------------- اطلاعات تماس -------------------- */
.contact-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1.5px dashed rgba(139, 0, 0, .2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.contact-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B0000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(139, 0, 0, .03);
    padding: 8px 18px;
    border-radius: 40px;
}

.contact-phone {
    background: linear-gradient(145deg, #8B0000, #660000);
    color: #fff;
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 15px rgba(139, 0, 0, .3);
    border: 1px solid rgba(255, 255, 255, .15);
    direction: ltr;
}

.contact-phone i {
    font-size: 1.2rem;
}

/* -------------------- فرم داستان (story-form) -------------------- */
.story-form {
    background: #fff;
    border-radius: 30px;
    padding: 35px 40px;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, .1), 0 0 0 1px rgba(139, 0, 0, .1) inset;
    border-top: 6px solid #8B0000;
    transition: all .3s ease;
}

.story-form:hover {
    box-shadow: 0 30px 40px -15px rgba(139, 0, 0, .2), 0 0 0 1px rgba(139, 0, 0, .15) inset;
}

.form-title {
    font-size: 1.25rem !important;
    font-weight: 600;
    color: #8B0000;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 0, 0, .2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-title i {
    font-size: 1.6rem !important;
    color: #8B0000;
    background: rgba(139, 0, 0, .1);
    padding: 8px !important;
    border-radius: 50%;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.form-group label i {
    color: #8B0000;
    margin-left: 8px;
    width: 20px;
}

.required:after {
    content: " *";
    color: #8B0000;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 1.5px solid #e0e7ef;
    border-radius: 18px;
    background: #f9fbfd;
    transition: all .3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #8B0000;
    background: #fff;
    box-shadow: 0 5px 15px rgba(139, 0, 0, .1);
}

textarea.form-control {
    min-height: 180px;
    resize: vertical;
}

.btn-submit {
    background: linear-gradient(145deg, #8B0000, #660000);
    color: #fff;
    border: none;
    padding: 12px 25px !important;
    font-size: 1rem !important;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all .3s ease;
    display: block !important;
    width: fit-content;
    margin-right: auto !important;
    margin-left: 0 !important;
    margin-top: 15px;
    box-shadow: 0 10px 20px rgba(139, 0, 0, .3);
    border: 1px solid rgba(255, 255, 255, .2);
}

.btn-submit i {
    font-size: 1rem !important;
}

.btn-submit:hover {
    background: linear-gradient(145deg, #770000, #550000);
    transform: translateY(-3px);
    box-shadow: 0 18px 30px rgba(139, 0, 0, .4);
}

/* -------------------- فوتر -------------------- */
.footer {
    text-align: center;
    margin-top: 10px;
    padding: 30px 20px;
    color: #5a6a7a;
    font-size: .95rem;
    border-top: 1px solid rgba(139, 0, 0, .1);
    background: rgba(255, 255, 255, .5);
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* -------------------- کلاس‌های کمکی -------------------- */
.fixed-box {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    background-color: #f0f0f0;
    padding: 10px;
    z-index: 1000;
}

.mobile-font {
    font-size: 1.8em;
}

/* -------------------- ویزار (wizard) - فقط در b -------------------- */
.wizard {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #d6dde5;
}

.wizard .steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 10px 0;
    border-bottom: 2px solid #e0e0e0;
}

.wizard .step-indicator-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    background-color: #f1f1f1;
    color: #999;
    border-radius: 30px;
    margin: 0 5px;
    font-weight: bold;
    transition: all .3s;
}

.wizard .step-indicator-item.active {
    background-color: #8B0000;
    color: #fff;
}

.wizard .step-indicator-item.completed {
    background-color: #4CAF50;
    color: #fff;
}

.wizard .step {
    display: none;
}

.wizard .step.active {
    display: block;
}

.wizard .step h3 {
    color: #8B0000;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B0000;
}

.wizard label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: .95rem;
}

.wizard input[type="text"],
.wizard input[type="date"],
.wizard textarea,
.wizard select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: .95rem;
    background-color: #f9fafc;
}

.wizard input:focus,
.wizard textarea:focus,
.wizard select:focus {
    border-color: #8B0000;
    outline: none;
    background-color: #fff;
}

.wizard textarea {
    min-height: 80px;
    resize: vertical;
}

.wizard .checkbox-wrapper {
    margin-top: 12px;
    border: 1px solid #d6dde5;
    border-radius: 6px;
    padding: 16px;
    background-color: #f9fafc;
}

.wizard .checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.wizard .checkbox-item:hover {
    background-color: #ffeeee;
}

.wizard .checkbox-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: #8B0000;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    margin-left: 12px;
    font-weight: bold;
}

.wizard .selected-items {
    margin-top: 12px;
    padding: 12px 16px;
    background: #ffeeee;
    border-radius: 6px;
    border-right: 4px solid #8B0000;
}

.wizard .navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #d6dde5;
}

.wizard button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.wizard .btn-primary {
    background: #8B0000;
    color: #fff;
}

.wizard .btn-primary:hover {
    background: #6d0000;
}

.wizard .btn-secondary {
    background: #4CAF50;
    color: #fff;
}

.wizard .btn-secondary:hover {
    background: #3d8b40;
}

.wizard .btn-print {
    background: #ff9800;
    color: #fff;
}

.wizard .btn-print:hover {
    background: #e68900;
}

.wizard .btn-nav {
    background: #607d8b;
    color: #fff;
}

.wizard .btn-nav:hover {
    background: #455a64;
}

.wizard .btn-nav:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wizard .output-text {
    background: #f9fafc;
    border: 1px solid #d6dde5;
    border-radius: 8px;
    padding: 25px;
    min-height: 400px;
    line-height: 2;
    font-size: 1.05rem;
    white-space: pre-line;
    text-align: justify;
}

.wizard .action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.wizard .jalali-date {
    display: block;
    font-size: .85rem;
    color: #8B0000;
    margin-top: 5px;
    padding: 6px 12px;
    background-color: #ffeeee;
    border-radius: 4px;
    border-right: 3px solid #8B0000;
}

.wizard .date-input-wrapper {
    position: relative;
}

.wizard .db-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none; /* با php کنترل می‌شود */
}

.wizard .error-message {
    color: #8B0000;
    background-color: #ffe6e6;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}

.wizard .add-item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.wizard .add-item-row input {
    flex: 1;
}

.wizard .delete-item-btn {
    margin-right: auto;
    background: none;
    border: none;
    color: #8B0000;
    cursor: pointer;
    font-size: 1.1rem;
}

.wizard .delete-item-btn:hover {
    color: #6d0000;
}

/* -------------------- واکنش‌گرایی (media queries) -------------------- */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .hero-quote {
        padding: 25px 20px;
    }

    .story-form {
        padding: 25px 20px;
    }

    .contact-info {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .contact-phone {
        width: 100%;
        justify-content: center;
    }

    .menu-icon {
        left: 15px;
        width: 40px;
        height: 40px;
    }

    .menu-icon a {
        font-size: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header h2 {
        font-size: 1.2rem;
    }
    .header h3 {
        font-size: 1rem;
    }
}

@media print {
    .no-print {
        display: none;
    }
    .print-section {
    display: block !important;
    }
}