:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #00d2ff;
    --secondary: #928DAB;
    --accent: #3a7bd5;
    --text: #ffffff;
    --text-muted: #b3b3b3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glassmorphism Container */
.glass-container {
    width: 95vw;
    height: 90vh;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Sidebar */
.sidebar {
    width: 350px;
    padding: 30px;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary);
}

.logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-glass {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.input-glass:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

.input-glass::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

select.input-glass {
    appearance: none;
    /* color: white; */
}

select.input-glass option {
    background: #24243e;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

#previewImage {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border: none;
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.header-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.badge {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.highlight-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card .value {
    font-size: 1.8rem;
    font-weight: 700;
    background: -webkit-linear-gradient(var(--primary), white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card .value.sub {
    font-size: 1.2rem;
    -webkit-text-fill-color: var(--text);
}

.chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    height: 350px;
    /* Fixed height for stability */
    margin-bottom: 20px;
    position: relative;
    /* Important for Chart.js responsive mode */
}

.ai-insight {
    margin-top: 20px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(58, 123, 213, 0.1);
    border: 1px solid rgba(58, 123, 213, 0.3);
}

.ai-insight h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.ai-insight p {
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Loader */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- LANDING PAGE STYLES --- */
.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    z-index: 100;
    overflow: hidden;
}

.landing-hero {
    text-align: center;
    z-index: 2;
    max-width: 600px;
    padding: 20px;
    animation: fadeIn 1s ease-out;
}

.logo-large h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
}

.logo-large span {
    color: var(--primary);
}

.landing-hero h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 300;
    color: var(--text);
}

.landing-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
    line-height: 1.6;
}

.auth-box {
    padding: 40px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: rgba(0, 210, 255, 0.05);
}

.auth-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.auth-form .btn-primary {
    margin-top: 10px;
}

/* Background Animations */
.floating-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite alternate;
}

.blob.color-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob.color-2 {
    width: 500px;
    height: 500px;
    background: #6c5ce7;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

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

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

@keyframes float {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    body {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px;
    }

    .glass-container {
        width: 100%;
        height: auto;
        flex-direction: column;
        border-radius: 16px;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 20px;
        overflow-y: visible;
    }

    .main-content {
        padding: 20px;
        overflow-y: visible;
    }

    .highlight-cards {
        grid-template-columns: 1fr;
    }

    .header-result {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Landing Page Mobile */
    .landing-page {
        position: fixed;
        height: 100%;
        width: 100%;
        overflow-y: auto;
        padding: 20px 10px;
    }

    .logo-large h1 {
        font-size: 2.5rem;
    }

    .landing-hero h2 {
        font-size: 1.4rem;
    }

    .landing-hero p {
        font-size: 1rem;
    }

    .auth-box {
        padding: 20px;
    }
}