/* style.css - Elegant AI-First UI, Fully Responsive, Print-Ready */

/* ====================================================
   1. GLOBAL THEME VARIABLES (Light & Dark Mode)
   ==================================================== */
:root[data-theme="light"] {
    /* --- Modern Sleek Variables --- */
    --bg-body: #f4f4f5;
    --bg-card: #ffffff;
    --text-main: #18181b;
    --text-muted: #71717a;
    --border-color: #e4e4e7;
    --sidebar-bg: #ffffff;
    /* Updated to requested Blue-Green Gradient */
    --btn-bg: linear-gradient(135deg, #1b6bf5 0%, #30e854 100%);
    --accent-color: #1b6bf5;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-glow: 0 0 15px rgba(27, 107, 245, 0.2); /* Blue glow */
    --input-bg: #fafafa;
    --table-head: #fafafa;
    --row-hover: #f4f4f5;

    /* --- LEGACY Compatibility --- */
    --neu-bg: #ffffff;
    --neu-text: #18181b;
    --neu-muted: #71717a;
    --neu-accent: #1b6bf5;
    --neu-dark: rgba(0, 0, 0, 0.05);
    --neu-light: #ffffff;
}

:root[data-theme="dark"] {
    /* --- Elegant AI-First Dark Variables --- */
    --bg-body: #0a0a0c;
    --bg-card: #18181c;
    --text-main: #ffffff;
    --text-muted: #8b8b9b;
    --border-color: #2c2c35;
    --sidebar-bg: #18181c;
    /* Updated to requested Blue-Green Gradient */
    --btn-bg: linear-gradient(135deg, #1b6bf5 0%, #30e854 100%);
    --accent-color: #1b6bf5;
    --shadow-sm: 0 8px 20px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 15px rgba(27, 107, 245, 0.3); /* Blue glow */
    --input-bg: #121216;
    --table-head: #121216;
    --row-hover: #1f1f26;

    /* --- LEGACY Compatibility --- */
    --neu-bg: #18181c;
    --neu-text: #ffffff;
    --neu-muted: #8b8b9b;
    --neu-accent: #1b6bf5;
    --neu-dark: rgba(0, 0, 0, 0.4);
    --neu-light: rgba(255, 255, 255, 0.02);
}

/* ====================================================
   2. BASE & RESET
   ==================================================== */
* { box-sizing: border-box; }

body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (min-width: 768px) {
    ::-webkit-scrollbar { width: 8px; height: 8px; }
}

/* ====================================================
   3. MODALS & OVERLAYS
   ==================================================== */
.modal { display: none; }
.modal.show { display: flex; animation: fadeIn 0.2s ease-out; }

#modalBox {
    display: flex; flex-direction: column; max-height: 90vh; width: 100%; margin: 0 auto;
    background: var(--bg-card); border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    border-radius: 20px; overflow: hidden;
}
#modalBody { overflow-y: auto; flex: 1 1 auto; padding: 1.5rem; }
#modalFooter, #modalBox > div:first-child { flex: 0 0 auto; }

/* ====================================================
   4. TOAST NOTIFICATIONS
   ==================================================== */
.toast {
    display: none; transition: transform 0.3s ease, opacity 0.3s ease; z-index: 9999;
    background: var(--bg-card); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm); color: var(--text-main);
    border-radius: 14px; padding: 1rem 1.25rem;
}
.toast.show { display: flex; animation: slideUp 0.3s ease-out; }

/* ====================================================
   5. CHIPS & BADGES (Neon UI Style)
   ==================================================== */
.chip {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem;
    border-radius: 9999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
    border: 1px solid transparent; letter-spacing: 0.02em;
}
.chip-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.25); }
.chip-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.25); }
.chip-yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.25); }
.chip-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }
.chip-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border-color: rgba(168, 85, 247, 0.25); }
.chip-gray { background: var(--bg-body); color: var(--text-muted); border-color: var(--border-color); }

.badge { 
    font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 6px; 
    background: var(--bg-body); color: var(--text-muted); 
    font-weight: 700; border: 1px solid var(--border-color);
}

/* ====================================================
   6. BUTTONS
   ==================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border-radius: 12px; padding: 0.6rem 1.2rem; font-weight: 600; white-space: nowrap;
    transition: all 0.2s ease; cursor: pointer; min-height: 42px; border: none;
    letter-spacing: 0.02em;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(100%); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; min-height: 36px; border-radius: 10px; }

.btn-primary { 
    background: var(--btn-bg); 
    color: #ffffff !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.btn-primary:hover:not(:disabled) { 
    box-shadow: var(--shadow-glow); 
    transform: translateY(-1px);
}

.btn-soft { 
    background: var(--bg-card); 
    color: var(--text-main); 
    border: 1px solid var(--border-color); 
}
.btn-soft:hover:not(:disabled) { 
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(27, 107, 245, 0.15);
}

.btn-danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) { 
    background: rgba(239, 68, 68, 0.2); 
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ====================================================
   7. CARDS
   ==================================================== */
.card {
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 16px;
    box-shadow: var(--shadow-sm); 
    transition: box-shadow 0.2s, border-color 0.3s;
}
.card:hover {
    border-color: rgba(27, 107, 245, 0.3);
}
.card-h { 
    padding: 1.25rem 1.5rem 1rem 1.5rem; 
    border-bottom: 1px solid var(--border-color); 
}
.card-b { padding: 1.5rem; }

/* ====================================================
   8. FORM ELEMENTS (Elegant Inputs)
   ==================================================== */
.inp, .select {
    width: 100%; 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 0.65rem 1rem;
    outline: none; 
    transition: all 0.2s ease; 
    background: var(--input-bg); 
    color: var(--text-main);
    font-size: 0.9rem; 
    min-height: 42px;
}
.inp::placeholder { color: var(--text-muted); opacity: 0.7; }
.inp:focus, .select:focus { 
    border-color: var(--accent-color); 
    box-shadow: 0 0 0 3px rgba(27, 107, 245, 0.15); 
    background: var(--bg-card);
}
.inp:disabled, .select:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    background: var(--bg-body);
}

/* Checkboxes & Radios Custom Glow */
input[type="checkbox"], input[type="radio"] {
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* ====================================================
   9. TABLES
   ==================================================== */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { 
    padding: 0.85rem 1.25rem; 
    border-bottom: 1px solid var(--border-color); 
    vertical-align: middle; 
}
.table thead th {
    font-size: 0.7rem; 
    text-transform: uppercase; 
    letter-spacing: 0.08em; 
    font-weight: 800;
    color: var(--text-muted); 
    background: var(--table-head); 
    position: sticky; 
    top: 0;
    z-index: 10; 
    border-bottom: 2px solid var(--border-color);
}
.row-hover { transition: background-color 0.2s ease; cursor: pointer;}
.row-hover:hover { background: var(--row-hover); }

/* ====================================================
   10. ANIMATIONS
   ==================================================== */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes slideUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}