/* ==========================================================================
   SKELETON THEME V2026 - AREPA TOOL
   High-performance, glassmorphism-inspired, dark-mode-first design system.
   ========================================================================== */

/* 1. TOKENS & VARIABLES
   ========================================================================== */
:root {
    /* Brand Colors - Preserving Original Green */
    --primary-50:  #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #059669; /* core */
    --primary-600: #047857;
    --primary-700: #065f46;
    --primary-800: #064e3b;
    --primary-900: #022c22;
    --primary-glow: rgba(5, 150, 105, 0.4);

    /* Surface Colors (Slate/Dark Blue Grey) */
    --surface-50:  #f8fafc;
    --surface-100: #f1f5f9;
    --surface-200: #e2e8f0;
    --surface-300: #cbd5e1;
    --surface-400: #94a3b8;
    --surface-500: #64748b;
    --surface-600: #475569;
    --surface-700: #334155;
    --surface-800: #1e293b;
    --surface-900: #0f172a;
    --surface-950: #020617;

    /* Semantic */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error:   #ef4444;
    --color-info:    #3b82f6;

    /* Typography */
    --font-heading: 'Orbitron', 'Inter', sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Glassmorphism */
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 16px;
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    /* Spacing & Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --header-height: 80px;
    --sidebar-width: 280px;
    
    --container-max: 1400px;
}

/* 2. BASE & RESET
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--surface-950);
    color: var(--surface-50);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    /* Subtle mesh gradient background */
    background-image: 
        radial-gradient(at 0% 0%, rgba(5, 150, 105, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* 3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--surface-50);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; letter-spacing: -0.03em; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary-400), var(--color-info));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-subtle { color: var(--surface-400); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* 4. COMPONENTS
   ========================================================================== */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--primary-500);
    color: white;
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background: var(--primary-400);
    box-shadow: 0 0 30px rgba(5, 150, 105, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--surface-50);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-500);
    color: var(--primary-400);
}

.btn-outline:hover {
    background: var(--primary-500);
    color: white;
    transform: translateY(-2px);
}

.btn-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* --- Cards / Glass --- */
.card {
    background: var(--surface-800);
    border: 1px solid var(--surface-700);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card:hover {
    border-color: var(--primary-500);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.feature-card {
    @extend .card;
    background: linear-gradient(145deg, var(--surface-800) 0%, var(--surface-900) 100%);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--color-info));
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover::before { opacity: 1; }

/* --- Inputs --- */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--surface-300);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--surface-400);
    pointer-events: none;
    transition: color 0.3s;
}

.form-control {
    width: 100%;
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    color: var(--surface-50);
    padding: 0.8rem 1rem 0.8rem 2.8rem; /* Padding for icon */
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
    background: var(--surface-950);
}

.form-control:focus + i, .input-group:focus-within i {
    color: var(--primary-400);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--surface-600);
    border-radius: 4px;
    background: var(--surface-900);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.form-check input[type="checkbox"]:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.form-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 0.9rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: rgba(5, 150, 105, 0.2); color: var(--primary-300); border: 1px solid rgba(5, 150, 105, 0.3); }
.badge-secondary { background: rgba(100, 116, 139, 0.2); color: var(--surface-300); border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* 5. LAYOUTS
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    gap: 2rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--surface-50);
}

.brand img { height: 40px; width: auto; }

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--surface-300);
    position: relative;
    padding: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-400);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; width: 0; height: 2px;
    background: var(--primary-500);
    transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* --- Mobile Menu --- */
.mobile-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 768px) {
    .nav-menu { display: none; } /* Add toggle logic if needed, simplify for now */
    .mobile-toggle { display: block; }
}

/* --- App Layout (Files/Dashboard) --- */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.app-sidebar {
    background: var(--surface-900);
    border-right: 1px solid var(--surface-800);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    padding: 2rem 1rem;
    overflow-y: auto;
}

.app-main {
    padding: 2rem;
    margin-top: var(--header-height); /* Offset for fixed header */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    color: var(--surface-400);
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-item:hover, .sidebar-item.active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--primary-400);
}

.sidebar-item i { font-size: 1.2rem; min-width: 24px; text-align: center; }

/* 6. UTILITIES
   ========================================================================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* 7. ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* 8. AUTH PAGE SPECIFIC
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    /* Animated background blobs */
    overflow: hidden;
}

.auth-wrapper::before, .auth-wrapper::after {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.2;
}
.auth-wrapper::before { background: var(--primary-500); top: -20%; left: -20%; }
.auth-wrapper::after { background: var(--color-info); bottom: -20%; right: -20%; }

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 9. MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: all 0.3s;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-panel {
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    border-radius: var(--radius-xl);
    width: 90%; max-width: 500px;
    padding: 2rem;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-panel { transform: scale(1); }

/* 10. ALERTS
   ========================================================================== */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
