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

:root {
    --bg-deep: #0b0c15;
    --bg-panel: rgba(20, 22, 31, 0.7);
    --border-light: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-deep);
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.brand-header h1 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.brand-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: white;
    font-family: var(--font-mono);
}

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

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-family: var(--font-mono);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--primary);
}

.navbar {
    background: rgba(11, 12, 21, 0.9);
    border-bottom: 1px solid var(--border-light);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: 0.3s;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    padding: 25px;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-top: 5px;
}

.stat-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    opacity: 0.1;
}

.workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
    height: 600px;
}

.sidebar-controls {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-viewport {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.drop-area {
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-area:hover,
.drop-area.highlight {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.preview-container {
    display: none;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    /* Better for mobile */
}

.user-badge {
    position: relative;
    cursor: pointer;
    padding: 5px 15px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: #0b0c15;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: 180px;
    box-shadow: 0 10px 30px black;
    z-index: 200;
}

.user-badge:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.analysis-panel {
    width: 100%;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.bars {
    display: flex;
    gap: 5px;
    height: 60px;
    align-items: flex-end;
    justify-content: center;
    margin-top: 10px;
}

.bar {
    flex: 1;
    background: var(--primary);
    opacity: 0.6;
    transition: height 0.5s;
}

.remove-img-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--danger);
    border: 1px solid var(--danger);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

.remove-img-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

/* NEW: Profile Avatar Style */
.avatar-circle {
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 2.5rem;
    color: var(--primary);
}

/* --- MOBILE RESPONSIVENESS --- */

/* Tablet & Mobile Breakpoint */
@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
    }

    .sidebar-controls {
        order: 2;
        /* Put controls below image on mobile */
    }

    .main-viewport {
        min-height: 300px;
    }
}

/* Phone Breakpoint */
@media (max-width: 768px) {
    .navbar {
        padding: 15px;
    }

    .nav-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-item {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .dashboard-container {
        padding: 15px;
    }

    .auth-card {
        padding: 25px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Better touch targets for buttons */
    .btn-primary,
    .form-input {
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 14px;
    }
}