/* ==========================================================================
   ATRIC HUB - PREMIUM STYLE SYSTEM (IT TICKETING SYSTEM)
   Designed by Antigravity AI | Font: Outfit
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;600;700&display=swap');

:root {
    /* Color Palette (HSL Tailored) */
    --primary-h: 224;
    --primary-s: 71%;
    --primary-l: 22%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-light: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 10%));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
    
    --accent: hsl(200, 95%, 45%);
    --accent-glow: hsla(200, 95%, 45%, 0.2);
    
    --bg-main: hsl(220, 25%, 97%);
    --bg-card: hsl(0, 0%, 100%);
    
    /* Text Colors */
    --text-main: hsl(224, 25%, 15%);
    --text-muted: hsl(224, 16%, 36%);
    
    /* Semantic Status Colors (HSL) */
    --status-pending-h: 38;
    --status-pending-s: 92%;
    --status-pending-l: 35%;
    --status-pending: hsl(var(--status-pending-h), var(--status-pending-s), var(--status-pending-l));
    --status-pending-bg: hsla(var(--status-pending-h), var(--status-pending-s), var(--status-pending-l), 0.12);

    --status-progress-h: 195;
    --status-progress-s: 85%;
    --status-progress-l: 35%;
    --status-progress: hsl(var(--status-progress-h), var(--status-progress-s), var(--status-progress-l));
    --status-progress-bg: hsla(var(--status-progress-h), var(--status-progress-s), var(--status-progress-l), 0.12);

    --status-done-h: 142;
    --status-done-s: 68%;
    --status-done-l: 30%;
    --status-done: hsl(var(--status-done-h), var(--status-done-s), var(--status-done-l));
    --status-done-bg: hsla(var(--status-done-h), var(--status-done-s), var(--status-done-l), 0.12);

    --status-closed-h: 215;
    --status-closed-s: 15%;
    --status-closed-l: 35%;
    --status-closed: hsl(var(--status-closed-h), var(--status-closed-s), var(--status-closed-l));
    --status-closed-bg: hsla(var(--status-closed-h), var(--status-closed-s), var(--status-closed-l), 0.12);

    --status-urgent: hsl(354, 75%, 38%);
    --status-urgent-bg: hsla(354, 75%, 38%, 0.12);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --grad-navbar: linear-gradient(180deg, hsl(224, 71%, 15%) 0%, hsl(224, 71%, 10%) 100%);
    --grad-accent: linear-gradient(135deg, var(--accent) 0%, hsl(200, 95%, 35%) 100%);
    
    /* Design Tokens */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 15px 40px rgba(26, 35, 126, 0.08);
    --shadow-focus: 0 0 0 4px var(--primary-glow);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Typography */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', 'Cairo', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* RTL Layout Compatibility */
body[dir="rtl"] {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

/* Custom Gradients & Hero Utilities */
.bg-gradient-primary {
    background: var(--grad-primary) !important;
}

.text-gradient-primary {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Auth Cards */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(26, 35, 126, 0.05) 0%, rgba(0, 0, 0, 0) 80%);
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    width: 100%;
}

.auth-card:hover {
    box-shadow: 0 20px 50px rgba(26, 35, 126, 0.12);
    transform: translateY(-2px);
}

.auth-card-header {
    background: var(--grad-primary);
    color: #fff;
    padding: 35px 30px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.auth-card-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Premium Form Elements */
.form-control, .form-select {
    border: 1.5px solid hsl(220, 15%, 88%);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--bg-card);
    transition: var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-focus);
    background-color: var(--bg-card);
}

.form-label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    padding: 11px 24px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--grad-primary);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-light);
    box-shadow: 0 6px 18px rgba(26, 35, 126, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--status-done);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.btn-success:hover, .btn-success:focus {
    background: hsl(var(--status-done-h), var(--status-done-s), calc(var(--status-done-l) + 5%));
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

/* Navbar Upgrades */
.navbar {
    background: var(--grad-navbar) !important;
    padding: 15px 25px !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff !important;
}

/* Premium Dashboard Widgets */
.card-stat {
    border: none;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: translate(30px, -30px);
    z-index: -1;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-stat.bg-pending {
    background: linear-gradient(135deg, hsl(38, 92%, 45%) 0%, hsl(38, 92%, 35%) 100%) !important;
}
.card-stat.bg-progress {
    background: linear-gradient(135deg, hsl(195, 85%, 42%) 0%, hsl(195, 85%, 32%) 100%) !important;
}
.card-stat.bg-done {
    background: linear-gradient(135deg, hsl(142, 68%, 38%) 0%, hsl(142, 68%, 28%) 100%) !important;
}
.card-stat.bg-closed {
    background: linear-gradient(135deg, hsl(215, 15%, 45%) 0%, hsl(215, 15%, 35%) 100%) !important;
}

.card-stat h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

/* Dashboard Cards */
.card {
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.card.card-premium-shadow {
    box-shadow: var(--shadow-md);
}

.card.card-premium-shadow:hover {
    box-shadow: var(--shadow-lg);
}

/* Clean Tables styling */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 2px solid hsl(220, 15%, 94%);
    background-color: hsl(220, 15%, 98%);
}

.table td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid hsl(220, 15%, 94%);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition-smooth);
}

.table tbody tr:hover {
    background-color: hsl(220, 15%, 98.5%) !important;
}

/* Modern Pill Badges */
.badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pending {
    background-color: var(--status-pending-bg) !important;
    color: var(--status-pending) !important;
}

.badge-progress, .badge-in_progress {
    background-color: var(--status-progress-bg) !important;
    color: var(--status-progress) !important;
}

.badge-done {
    background-color: var(--status-done-bg) !important;
    color: var(--status-done) !important;
}

.badge-closed, .badge-refused {
    background-color: var(--status-closed-bg) !important;
    color: var(--status-closed) !important;
}

/* SLA Alerts (Soft warning red pulse) */
@keyframes pulse-sla {
    0% { background-color: rgba(248, 215, 218, 0.7); }
    50% { background-color: rgba(248, 215, 218, 1); }
    100% { background-color: rgba(248, 215, 218, 0.7); }
}

.sla-alert td, .sla-blink td {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    animation: pulse-sla 2s infinite ease-in-out;
}

/* Chat thread design */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reply-bubble {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    max-width: 80%;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.reply-bubble:hover {
    box-shadow: var(--shadow-md);
}

.reply-employee {
    background-color: hsl(220, 15%, 96%);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.reply-staff {
    background-color: hsla(var(--primary-h), var(--primary-s), 97%, 1);
    border-left: 4px solid var(--primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

body[dir="rtl"] .reply-staff {
    border-left: none;
    border-right: 4px solid var(--primary);
}

/* Chat Action React Bar */
.react-bar {
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 10px;
    padding-top: 8px;
}

.react-btn {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.02);
    transition: var(--transition-smooth);
}

.react-btn:hover {
    background-color: rgba(0,0,0,0.06);
    color: var(--text-main);
}

/* Utility Animations */
.hover-lift {
    transition: var(--transition-smooth);
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Language and Quick Actions Bar */
.language-selector {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 10;
}

body[dir="rtl"] .language-selector {
    right: auto;
    left: 25px;
}

/* ==========================================================================
   ATRIC HUB v2 - CONTRAST & ACCESSIBILITY BOOST OVERRIDES
   ========================================================================== */

.text-dark-slate {
    color: #0f172a !important;
}

.text-dark-navy {
    color: #1e293b !important;
}

/* Ensure all headers inside cards are sharp dark slate */
.card-title, .card h5, .card h6 {
    color: #0f172a !important;
    font-weight: 700 !important;
}

/* Overriding faint default muted grey to compliant slate */
.text-muted {
    color: #475569 !important; /* Darker slate for standard muted text strings */
}

/* boost contrast on tables */
.table th {
    color: #0f172a !important;
    background-color: hsl(220, 15%, 94%) !important;
    font-weight: 700 !important;
}

.table td {
    color: #1e293b !important;
}

/* Sidebar Navigation Items */
.sidebar-wrapper {
    background-color: var(--bg-card);
    border-right: 1px solid hsl(220, 15%, 92%);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-wrapper::-webkit-scrollbar {
    width: 5px;
}

.sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.sidebar-nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
}

.sidebar-nav-link:hover {
    background-color: var(--primary-glow);
    color: var(--primary);
}

.sidebar-nav-link:hover i {
    color: var(--primary);
}

.sidebar-nav-link.active {
    background-color: var(--primary);
    color: #fff;
}

.sidebar-nav-link.active i {
    color: #fff;
}

.sidebar-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 800;
    margin-top: 20px;
    margin-bottom: 6px;
    padding-left: 16px;
}

/* تحسين استجابة وتوافق السايدبار مع شاشات الهواتف المحمولة (Drawer Slide-in Sidebar) */
@media (max-width: 767.98px) {
    .sidebar-wrapper {
        position: fixed !important;
        top: 0;
        left: -280px; /* مخفي خارج الشاشة يساراً */
        width: 280px;
        height: 100vh !important;
        z-index: 2000 !important;
        background-color: var(--bg-card);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease-in-out;
        padding: 20px 15px !important;
        display: flex !important;
        flex-direction: column;
    }
    
    .sidebar-wrapper.show {
        left: 0 !important; /* يدخل الشاشة عند استدعائه */
    }
    
    .sidebar-heading {
        margin-top: 10px;
    }
}

