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

:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #0f1118;
    --bg-tertiary: #161a23;
    --accent-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 50%, #9d50bb 100%);
    --accent-blue: #00d2ff;
    --text-primary: #ffffff;
    --text-secondary: #b0b3b8;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #00e676;
    --sidebar-width: 280px;

    /* Breakpoints */
    --sm: 576px;
    --md: 768px;
    --lg: 992px;
    --xl: 1200px;

    /* Animation */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= GLOBAL ================= */

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

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

@media (max-width: 480px) {
    html {
        font-size: 17px;
        /* Slightly larger base for mobile app feel */
    }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ================= HERO SECTION ================= */

#hero-page {
    padding: 5rem 1.25rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(0, 210, 255, 0.08), transparent 50%),
        radial-gradient(circle at bottom left, rgba(157, 80, 187, 0.08), transparent 50%);
}

@media (min-width: 768px) {
    #hero-page {
        min-height: 100vh;
        padding: 4rem 2rem;
    }
}

.hero-content {
    width: 100%;
    max-width: 56rem;
}

.hero-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 3rem;
    font-size: 0.8rem;
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 210, 255, 0.2);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        max-width: none;
    }
}

/* ================= BUTTONS ================= */

.btn-primary,
.btn-secondary {
    padding: 0.875rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    backdrop-filter: blur(5px);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 210, 255, 0.3);
    }

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

/* ================= DASHBOARD LAYOUT ================= */

#dashboard-layout {
    display: none;
    min-height: 100vh;
    grid-template-columns: 1fr;
}

#dashboard-layout.active {
    display: grid;
}

@media (min-width: 1200px) {
    #dashboard-layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
}

/* ================= SIDEBAR (Drawer) ================= */

aside {
    background: rgba(15, 17, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    transform: translateX(100%);
    transition: var(--transition-smooth);
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

aside.active {
    transform: translateX(0);
}

@media (min-width: 1200px) {
    aside {
        position: sticky;
        left: 0;
        transform: translateX(0);
        width: var(--sidebar-width);
        max-width: var(--sidebar-width);
        z-index: 100;
        background: var(--bg-secondary);
        backdrop-filter: none;
    }

    .close-btn {
        display: none !important;
    }
}

.close-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    margin-left: auto;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1500;
}

#sidebar-overlay.active {
    display: block;
}

@media (min-width: 992px) {
    aside {
        position: sticky;
        transform: translateX(0);
        z-index: 100;
        padding: 2rem 1.25rem;
    }

    #sidebar-overlay {
        display: none !important;
    }
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-circle {
    width: 30px;
    height: 30px;
    background: var(--accent-gradient);
    border-radius: 8px;
}

nav ul {
    list-style: none;
}

nav li {
    padding: 1rem 1.25rem;
    /* Larger touch target for sidebar items */
    border-radius: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

nav li:hover,
nav li.active {
    background: var(--glass-bg);
    color: white;
}

/* ================= MAIN CONTENT ================= */

main {
    padding: 1.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    main {
        padding: 2.5rem;
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 2.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-top: -1.5rem;
    transition: var(--transition-smooth);
}

.top-bar.scrolled {
    background: rgba(10, 11, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

@media (min-width: 768px) {
    .top-bar {
        margin-left: -2.5rem;
        margin-right: -2.5rem;
        margin-top: -2.5rem;
        padding: 1.25rem 2.5rem;
    }
}

.menu-toggle {
    display: flex;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.6rem;
    border-radius: 0.75rem;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

@media (min-width: 1200px) {
    .menu-toggle {
        display: none;
    }
}

/* ================= DASHBOARD CARDS ================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Stay 1 column longer for visual impact */
    }
}

@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.25rem;
    /* Bolder value */
    font-weight: 800;
    margin: 0.5rem 0;
    color: white;
    letter-spacing: -0.01em;
}

.up {
    color: var(--success);
    font-size: 0.875rem;
}

/* ================= FORM ================= */

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.full-width {
    grid-column: 1 / -1;
}

input,
select {
    width: 100%;
    padding: 1rem 1.25rem;
    /* Larger padding for better touch */
    border-radius: 0.85rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.1);
}

.card-container {
    background: var(--bg-tertiary);
    padding: 1.75rem 1rem;
    /* More space for content, less on horizontal edges */
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 56rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .card-container {
        padding: 3rem;
    }
}

/* ================= AUTH MODAL ================= */

#auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    z-index: 9999;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    background: var(--bg-tertiary);
    padding: 2.5rem 1.5rem;
    border-radius: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 1.5rem 1.5rem 0 0;
        /* Bottom-sheet-like feel on mobile */
        position: fixed;
        bottom: 0;
        max-width: 100%;
    }

    #auth-overlay {
        align-items: flex-end;
        /* Align to bottom for app feel */
        padding: 0;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ================= UTILS ================= */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}