/* 
 * e-Matab Ultimate Premium Professional Theme & Design System
 * Modern, Minimalist, Clean Slate & Flat-Card Aesthetics
 * Highly Responsive & Fully Optimized for Desktop & Mobile
 */

@font-face {
    font-family: 'PeydaFaNum';
    src: url('../../fonts/PeydaWebFaNum-Regular.woff2') format('woff2'),
         url('../../fonts/PeydaWebFaNum-Regular.woff') format('woff'),
         url('../../fonts/PeydaFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaFaNum';
    src: url('../../fonts/PeydaWebFaNum-Bold.woff2') format('woff2'),
         url('../../fonts/PeydaWebFaNum-Bold.woff') format('woff'),
         url('../../fonts/PeydaFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('../../fonts/IRANSansXFaNum-Regular.woff2') format('woff2'),
         url('../../fonts/IRANSansXFaNum-Regular.woff') format('woff'),
         url('../../fonts/IRANSansXFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('../../fonts/IRANSansXFaNum-Bold.woff2') format('woff2'),
         url('../../fonts/IRANSansXFaNum-Bold.woff') format('woff'),
         url('../../fonts/IRANSansXFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

:root {
    /* Color Palette */
    --primary: #002841;
    --primary-light: #0d3b5c;
    --primary-dark: #051a29;
    --primary-glow: rgba(0, 40, 65, 0.04);
    --secondary: rgb(194, 50, 122);
    --secondary-hover: rgb(170, 40, 105);
    --secondary-light: rgba(194, 50, 122, 0.05);
    --accent: #7c3aed;
    --accent-light: rgba(124, 58, 237, 0.05);
    
    /* Base Backgrounds */
    --bg-base: #f8fafc;
    --bg-gradient: radial-gradient(circle at 100% 0%, rgba(0, 40, 65, 0.03) 0%, transparent 50%), 
                  #f8fafc;
    --white: #ffffff;
    --card-bg: #ffffff;
    
    /* Slate Color Scale */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-750: #2a3547;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #047857;
    --danger: #f43f5e;
    --danger-light: #ffe4e6;
    --danger-dark: #be123c;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #b45309;
    --info: #06b6d4;
    --info-light: #ecfeff;
    --info-dark: #0e7490;
    
    /* Professional Layout Border Radii (Clean, Not too round) */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Professional Clean Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
    
    /* Typography */
    --font-heading: 'PeydaFaNum', sans-serif;
    --font-body: 'IRANSansXFaNum', sans-serif;
}

/* Global Reset & Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.7;
    color: var(--slate-700);
    background: var(--bg-gradient);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--slate-900);
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

h1 { font-size: 2rem; font-weight: 900; }
h2 { font-size: 1.6rem; font-weight: 900; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--primary);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ==========================================================================
   CARDS & PANELS (Sleek, Clean, radius-md: 8px)
   ========================================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px !important;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--slate-300);
}

.glass-panel {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 24px !important;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

/* ==========================================================================
   BUTTONS (Professional, radius-sm: 6px)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    text-align: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: var(--white) !important;
}
.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white) !important;
}
.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--slate-300);
    color: var(--slate-700);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--slate-50);
}

.btn-sm {
    padding: 0.45rem 0.2rem;
    font-size: 0.57rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   INPUTS & FORM FIELDS (Clean, radius-sm: 6px)
   ========================================================================== */
.service-field {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}
.service-field label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--slate-800);
    margin-bottom: 0.4rem;
}
.service-field input, 
.service-field select, 
.service-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--slate-800);
    transition: all 0.2s ease;
    outline: none;
}
.service-field input:focus, 
.service-field select:focus, 
.service-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 40, 65, 0.06);
}

.service-field input::placeholder {
    color: var(--slate-400);
}

/* ==========================================================================
   LAYOUT HEADER & SIDEBAR
   ========================================================================== */
.boxed-header {
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 2rem;
}

.user-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 100px);
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    align-items: flex-start;
}

.dashboard-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: fit-content;
    position: sticky;
    top: 5rem;
    z-index: 10;
}

.dashboard-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--slate-700) !important;
    transition: all 0.15s ease;
}

.dashboard-sidebar ul li a:hover,
.dashboard-sidebar ul li a.active-link {
    background: var(--slate-50);
    color: var(--primary) !important;
}

.dashboard-sidebar ul li a.active-item {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.dashboard-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* ==========================================================================
   STATUS BADGES (Clean, Professional, radius-xs: 4px)
   ========================================================================== */
.service-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    gap: 4px;
}

.badge-gray { background-color: var(--slate-100); color: var(--slate-600); }
.badge-success { background-color: var(--success-light); color: var(--success-dark); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-dark); }
.badge-warning { background-color: var(--warning-light); color: var(--warning-dark); }
.badge-info { background-color: var(--info-light); color: var(--info-dark); }

/* ==========================================================================
   LOBBY TABLE STYLING
   ========================================================================== */
.lobby-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--slate-200);
}

.lobby-table th {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--slate-900);
    background: var(--slate-100);
    border-bottom: 1.5px solid var(--slate-200);
    padding: 0.85rem 1rem;
}

.lobby-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--slate-200);
    background: var(--white);
    transition: background 0.15s ease;
}

.lobby-table tr:last-child td {
    border-bottom: none;
}

.lobby-table tr:hover td {
    background: var(--slate-50);
}

/* ==========================================================================
   ODONTOGRAM TEETH STYLING (radius-xs: 4px)
   ========================================================================== */
.tooth-box {
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-xs);
    background: var(--white);
    transition: all 0.15s ease;
}

.tooth-box:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tooth-box.active-tooth {
    border-color: var(--secondary) !important;
    background: var(--secondary-light) !important;
}

.tooth-box.treated-tooth {
    background: rgba(0, 40, 65, 0.05) !important;
    border-color: var(--primary) !important;
}

/* ==========================================================================
   AI CHAT TRIAGE STYLING (radius-md: 8px)
   ========================================================================== */
#triage-chat-box {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

#chat-messages > div {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
}

.msg-user {
    background: var(--secondary-light);
    color: var(--secondary-hover);
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.msg-ai {
    background: var(--primary-glow);
    color: var(--primary-light);
    align-self: flex-end;
    border-top-right-radius: 2px;
}

#chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

/* Timeline & FAQ */
.timeline-track {
    position: relative;
    padding-right: 2.5rem;
}

.timeline-track::before {
    content: '';
    position: absolute;
    right: 12px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--slate-200);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    right: -2.5rem;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    font-family: var(--font-heading);
}

/* ==========================================================================
   MOBILE BOTTOM BAR WEB APP STYLING
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    border-top: 1px solid var(--slate-200);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--slate-500);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    flex: 1;
    font-family: var(--font-heading);
}

.mobile-bottom-nav-item i {
    font-size: 1.15rem;
}

.mobile-bottom-nav-item.active {
    color: var(--secondary);
}

/* ==========================================================================
   GRID LAYOUT UTILITIES
   ========================================================================== */
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN GRID ADAPTATIONS
   ========================================================================== */
@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .dashboard-sidebar {
        width: 100% !important;
        position: static !important;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 70px !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    .glass-panel, .card {
        padding: 16px !important;
    }
    div[style*="grid-template-columns"],
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    div:has(> table),
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Persian Datepicker Font Override */
.datepicker-plot-area, 
.datepicker-plot-area *,
.pwt-datepicker-input-element,
input.pwt-datepicker-input-element,
.shamsi-datepicker,
.shamsi-datetimepicker {
    font-family: var(--font-body) !important;
}

/* Triage Chat Header Styles */
.triage-chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 15;
    position: relative;
}

.triage-chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Premium Mobile Aesthetics & Full-Screen Triage Override */
@media (max-width: 768px) {
    /* 2. Section padding override from 2rem to 0.6rem */
    .dashboard-wrapper, 
    .container {
        padding: 0 0.6rem !important;
    }
    
    /* 3. Box padding override from 1.5rem to 0.6rem */
    .glass-panel, 
    .card, 
    .card[style], 
    .glass-panel[style] {
        padding: 0.6rem !important;
    }
    
    /* 4. Heading size h3 behaves as h4 */
    h3 {
        font-size: 1.1rem !important;
    }
    
    /* 5. Custom Full-Screen Triage Chat interface on mobile */
    #triage-chat-box {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 99999 !important;
    }
    
    .mobile-back-arrow {
        display: inline-block !important;
    }
    
    /* Restructured Triage Header on Mobile */
    .triage-chat-header {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0.8rem 1rem !important;
        gap: 12px !important;
    }
    
    .triage-chat-header-actions {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    
    .triage-chat-header-actions button {
        flex: 1 !important;
        justify-content: center !important;
        font-size: 0.76rem !important;
        padding: 0.45rem 0.5rem !important;
    }
}

