/* ============================================================================
   Online Mastery AI - Premium Styling System
   ============================================================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&family=Syne:wght@700;800&display=swap');

/* Color Variables */
:root {
    --background-hex: #030303;
    --background: 0 0% 4%;
    --foreground: 0 0% 100%;
    --border: 0 0% 13%;
    --card: 0 0% 7%;
    --card-foreground: 0 0% 100%;
    --card-border: 0 0% 13%;
    --popover: 0 0% 7%;
    --popover-foreground: 0 0% 100%;
    --popover-border: 0 0% 13%;
    
    /* Emerald/Online Mastery Green #00c896 */
    --primary: 165 100% 39%;
    --primary-rgb: 0, 200, 150;
    --primary-foreground: 0 0% 4%;
    
    /* Warm Gold #f59e0b */
    --secondary: 38 92% 50%;
    --secondary-foreground: 0 0% 4%;
    
    /* Gray/Muted */
    --muted: 0 0% 13%;
    --muted-foreground: 0 0% 60%;
    --accent: 0 0% 13%;
    --accent-foreground: 0 0% 100%;
    
    /* Red/Destructive */
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    
    /* Input & Ring */
    --input: 0 0% 10%;
    --ring: 165 100% 39%;
    
    /* Sidebar */
    --sidebar: 0 0% 4%;
    --sidebar-foreground: 0 0% 100%;
    --sidebar-border: 0 0% 13%;
    --sidebar-accent: 0 0% 10%;
    
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-display: 'Syne', sans-serif;
    
    --radius: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background-hex);
    color: hsl(var(--foreground));
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.3);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
}
.font-display {
    font-family: var(--font-display);
}
.font-mono {
    font-family: var(--font-mono);
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: rgb(var(--primary-rgb)); }
.text-secondary { color: hsl(var(--secondary)); }
.text-destructive { color: hsl(var(--destructive)); }

/* Layout & Containers */
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-6xl { max-width: 72rem; margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.pointer-events-none { pointer-events: none; }
.hidden { display: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-style: auto; overflow-y: auto; }
.select-all { user-select: all; }

/* Spacings */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }

/* Borders & Cards */
.border { border: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-t { border-top: 1px solid hsl(var(--border)); }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-3xl { border-radius: 24px; }
.rounded-full { border-radius: 9999px; }

/* Custom Glass Cards */
.card-glass {
    background: rgba(9, 9, 11, 0.4);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    transition: var(--transition);
}
.card-glass:hover {
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--primary-rgb), 0.03);
}

/* Background Gradients & Glows */
.bg-radial-glow {
    position: fixed;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.05);
    filter: blur(130px);
    pointer-events: none;
    z-index: 0;
}
.bg-radial-glow-left {
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.03);
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
    font-family: var(--font-sans);
}
.btn-primary {
    background-color: rgb(var(--primary-rgb));
    color: #000000;
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.25);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-secondary {
    background-color: hsl(var(--secondary));
    color: #000000;
}
.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}
.btn-outline {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.btn-outline:hover {
    background-color: hsl(var(--muted));
    border-color: rgba(var(--primary-rgb), 0.4);
    color: rgb(var(--primary-rgb));
}
.btn-ghost {
    background-color: transparent;
    color: hsl(var(--muted-foreground));
}
.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: hsl(var(--foreground));
}
.btn-destructive {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}
.btn-destructive:hover {
    background-color: #ef4444;
    color: #ffffff;
}
.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 9999px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.badge-outline {
    border-color: rgba(var(--primary-rgb), 0.3);
    color: rgb(var(--primary-rgb));
    background-color: rgba(var(--primary-rgb), 0.05);
}
.badge-secondary {
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.05);
}
.badge-destructive {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Inputs & Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    outline: none;
    transition: var(--transition);
}
.form-control:focus {
    border-color: rgb(var(--primary-rgb));
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.1);
}
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Checkbox Cards */
.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    color: hsl(var(--muted-foreground));
}
.checkbox-card.selected {
    border-color: rgb(var(--primary-rgb));
    background-color: rgba(var(--primary-rgb), 0.08);
    color: rgb(var(--primary-rgb));
}
.checkbox-indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.checkbox-card.selected .checkbox-indicator {
    border-color: rgb(var(--primary-rgb));
    background-color: rgb(var(--primary-rgb));
}
.checkbox-indicator svg {
    width: 0.625rem;
    height: 0.625rem;
    stroke: #000000;
    stroke-width: 3;
    display: none;
}
.checkbox-card.selected .checkbox-indicator svg {
    display: block;
}

/* Progress bar */
.progress-container {
    margin-bottom: 1.5rem;
}
.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.progress-bar-bg {
    width: 100%;
    height: 4px;
    background-color: hsl(var(--border));
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: rgb(var(--primary-rgb));
    border-radius: 9999px;
    transition: width 0.4s ease-out;
}

/* Dashboard Sidebar Structure */
.app-container {
    display: flex;
    min-h: 100vh;
    overflow: hidden;
}
.app-sidebar {
    width: 260px;
    background-color: #030303;
    border-right: 1px solid hsl(var(--border));
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.app-header-mobile {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background-color: #030303;
    border-bottom: 1px solid hsl(var(--border));
}
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 1.5rem;
    position: relative;
}

/* Sidebar Elements */
.sidebar-logo {
    padding: 1.5rem 1.25rem;
    font-family: var(--font-mono);
    color: rgb(var(--primary-rgb));
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.15em;
    border-bottom: 1px solid hsl(var(--border));
}
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}
.sidebar-link:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--foreground));
}
.sidebar-link.active {
    background-color: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.15);
    color: rgb(var(--primary-rgb));
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.05);
}
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: rgba(0, 0, 0, 0.2);
}

/* Profile Pill */
.profile-pill {
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(var(--card), 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.profile-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.profile-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 6px;
    background-color: rgba(var(--primary-rgb), 0.15);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--primary-rgb));
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}
.modal-container {
    width: 100%;
    max-width: 440px;
    background: #09090b;
    border: 1px solid hsl(var(--border));
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modal-zoom 0.2s ease-out;
}
@keyframes modal-zoom {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.modal-close {
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: hsl(var(--foreground));
}

/* Tabs */
.tab-headers {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.25rem;
}
.tab-header {
    flex: 1;
    background: transparent;
    border: none;
    padding-bottom: 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    position: relative;
    text-align: center;
}
.tab-header.active {
    color: hsl(var(--foreground));
}
.tab-header.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgb(var(--primary-rgb));
    border-radius: 9999px;
}

/* Dial Charts (SVGs) */
.dial-container {
    width: 110px;
    height: 110px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dial-text {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 1.375rem;
    font-weight: 700;
}

/* Highlight boxes */
.highlight-box {
    background-color: #18181b;
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 1.25rem;
}

/* Floating Accelerators card */
.accelerator-card {
    background-color: rgba(9, 9, 11, 0.4);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 16px;
    padding: 1.25rem;
}

/* Alert box */
.alert-box {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: start;
    border: 1px solid transparent;
}
.alert-destructive {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.alert-success {
    background-color: rgba(0, 200, 150, 0.08);
    border-color: rgba(0, 200, 150, 0.2);
    color: rgb(var(--primary-rgb));
}

/* Dropdowns */
.select-wrapper {
    position: relative;
}
.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}
.select-wrapper select:focus {
    border-color: rgb(var(--primary-rgb));
}
.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: hsl(var(--muted-foreground));
    width: 1rem;
    height: 1rem;
}

/* Custom CSS table lists (e.g. for Admin Dashboard) */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    text-align: left;
}
table.admin-table th {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid hsl(var(--border));
    padding: 1rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
}
table.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: hsl(var(--foreground));
}
table.admin-table tr:last-child td {
    border-bottom: none;
}

/* Mobile Sidebar Drawer Toggle */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 40;
}

/* Responsive queries */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-header-mobile {
        display: flex;
    }
    .app-content {
        padding: 1.5rem 1rem;
    }
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}
