/* ============================================================
   فایل استایل اصلی پروژه نوبت‌دهی
   با Bootstrap 5 + Font Awesome + وزیرمتن
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --gray-lighter: #f8fafc;
    --dark: #0f172a;
    --white: #ffffff;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.12);
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark);
    direction: rtl;
}

/* ===== کانتینر ===== */
.container-custom {
    max-width: 720px;
    margin: 0 auto;
}
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== کارت‌ها ===== */
.card-custom {
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}
.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.card-header-custom {
    background: var(--primary);
    color: var(--white);
    padding: 20px 25px;
    border: none;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
}
.card-body-custom {
    padding: 30px 25px;
}

/* ===== دکمه‌ها ===== */
.btn-custom {
    border-radius: 40px;
    padding: 12px 32px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-family: inherit;
}
.btn-custom .fa,
.btn-custom .fas,
.btn-custom .far {
    margin-left: 6px;
}

.btn-primary-custom {
    background: var(--primary);
    color: var(--white);
}
.btn-primary-custom:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
    color: var(--white);
}

.btn-success-custom {
    background: var(--success);
    color: var(--white);
}
.btn-success-custom:hover {
    background: #15803d;
    transform: scale(1.02);
    color: var(--white);
}

.btn-danger-custom {
    background: var(--danger);
    color: var(--white);
}
.btn-danger-custom:hover {
    background: #b91c1c;
    transform: scale(1.02);
    color: var(--white);
}

.btn-outline-custom {
    background: transparent;
    color: var(--gray);
    border: 2px solid #e2e8f0;
}
.btn-outline-custom:hover {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-custom:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}
.btn-custom-block {
    width: 100%;
}

/* ===== فرم‌ها ===== */
.form-control-custom {
    border-radius: var(--radius-xs);
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
}
.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    outline: none;
}
.form-label-custom {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    display: block;
}

/* ===== جدول ===== */
.table-custom {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-collapse: collapse;
}
.table-custom th,
.table-custom td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}
.table-custom th {
    background: var(--gray-lighter);
    color: var(--gray);
    font-weight: 700;
    font-size: 14px;
}
.table-custom tr:hover {
    background: var(--gray-lighter);
}

/* ===== نوبت‌ها ===== */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.slot-btn {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-xs);
    padding: 12px 8px;
    background: var(--white);
    transition: all 0.15s ease;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    text-align: center;
    font-size: 15px;
    font-family: inherit;
}
.slot-btn:hover:not(.disabled):not(.booked):not(.past-day):not(.off-day) {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}
.slot-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.slot-btn.disabled,
.slot-btn.booked,
.slot-btn.past-day,
.slot-btn.off-day {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-light);
    color: var(--gray);
    border-color: #e2e8f0;
}
.slot-btn.off-day {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fecaca;
    opacity: 0.7;
}
.slot-btn .fa {
    margin-left: 4px;
}

/* ===== روزها ===== */
.day-section {
    margin-bottom: 28px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 18px;
}
.day-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.day-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.day-title .badge-blue {
    background: var(--primary);
    color: var(--white);
    border-radius: 30px;
    padding: 4px 16px;
    font-size: 13px;
    font-weight: 600;
}
.day-title .date {
    color: var(--gray);
    font-weight: 400;
    font-size: 14px;
}
.day-title .past {
    color: var(--danger);
    font-size: 12px;
    background: var(--danger-light);
    padding: 2px 12px;
    border-radius: 30px;
}
.day-title .today-limit {
    color: var(--warning);
    font-size: 12px;
    background: var(--warning-light);
    padding: 2px 12px;
    border-radius: 30px;
}
.day-title .off-day-label {
    color: var(--danger);
    font-size: 12px;
    background: var(--danger-light);
    padding: 2px 12px;
    border-radius: 30px;
}
.day-title .fa {
    margin-left: 4px;
}

/* ===== بخش اطلاعات ===== */
.info-area {
    background: var(--gray-lighter);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.selected-info {
    font-size: 15px;
    color: #1e293b;
}
.selected-info strong {
    color: var(--dark);
}
.selected-info .fa {
    margin-left: 4px;
}

/* ===== پیام‌ها ===== */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    margin-top: 12px;
    font-weight: 500;
    text-align: center;
}
.message .fa,
.message .fas {
    margin-left: 6px;
}
.message-success {
    background: var(--success-light);
    color: var(--success);
}
.message-error {
    background: var(--danger-light);
    color: var(--danger);
}
.message-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ===== باکس اطلاعات ===== */
.info-box {
    background: var(--gray-lighter);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.info-box p {
    margin: 4px 0;
    color: var(--gray);
}
.info-box strong {
    color: var(--dark);
}

/* ===== کد پذیرش ===== */
.code-box {
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 2px dashed var(--primary);
    text-align: center;
    margin-bottom: 20px;
}
.code-box .label {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 5px;
}
.code-box .code {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: 2px;
    background: var(--white);
    padding: 8px 24px;
    border-radius: var(--radius-xs);
    display: inline-block;
    border: 1px solid #e2e8f0;
    font-family: monospace;
}

/* ===== پنل مدیریت ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: var(--dark);
    color: var(--white);
    padding: 25px 20px;
    flex-shrink: 0;
}
.admin-sidebar h2 {
    font-size: 20px;
    margin-bottom: 30px;
    text-align: center;
}
.admin-sidebar ul {
    list-style: none;
}
.admin-sidebar ul li {
    margin-bottom: 8px;
}
.admin-sidebar ul li a {
    display: block;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    transition: 0.2s;
}
.admin-sidebar ul li a .fa,
.admin-sidebar ul li a .fas {
    margin-left: 8px;
}
.admin-sidebar ul li a:hover {
    background: #334155;
    color: var(--white);
}
.admin-content {
    flex: 1;
    padding: 30px;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 12px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    display: block;
}
.stat-label {
    font-size: 14px;
    color: var(--gray);
}
.filter-box {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.filter-box .row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-box input,
.filter-box select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-xs);
    font-size: 14px;
    flex: 1;
    min-width: 120px;
    font-family: inherit;
}

/* ===== منوی پایین موبایل ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
    border-top: 1px solid #334155;
}
.mobile-bottom-nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px;
    transition: 0.2s;
    border-radius: 8px;
}
.mobile-bottom-nav a i {
    font-size: 20px;
    margin-bottom: 2px;
}
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.active {
    color: #3b82f6;
    background: #1e293b;
}
.mobile-bottom-nav a.logout {
    color: #ef4444;
}
.mobile-bottom-nav a.logout:hover {
    color: #dc2626;
    background: #1e293b;
}

/* ===== واکنش‌گرا ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none !important;
    }
    .mobile-bottom-nav {
        display: flex !important;
    }
    .admin-content {
        padding-bottom: 80px !important;
    }
    .admin-content {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    .card-body-custom {
        padding: 20px 15px;
    }
    .slots-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }
    .slot-btn {
        padding: 10px 4px;
        font-size: 13px;
    }
    .day-title {
        font-size: 15px;
        gap: 6px;
    }
    .day-title .badge-blue {
        font-size: 12px;
        padding: 3px 12px;
    }
    .day-title .date {
        font-size: 12px;
    }
    .day-title .past,
    .day-title .today-limit,
    .day-title .off-day-label {
        font-size: 10px;
        padding: 1px 8px;
    }
    .info-area {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 16px;
    }
    .btn-custom {
        width: 100%;
        text-align: center;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-box .row {
        flex-direction: column;
    }
    .filter-box input,
    .filter-box select {
        width: 100%;
        min-width: unset;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .code-box .code {
        font-size: 22px;
        padding: 6px 16px;
    }
}
@media (max-width: 400px) {
    .slots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}