/* 
   Theme Name: ML Platform Modern UI
   Font: 'Outfit', sans-serif
*/

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

:root {
    /* Colors */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.8);

    --primary: #8b5cf6;
    /* Violet 500 */
    --primary-hover: #7c3aed;
    /* Violet 600 */
    --primary-glow: rgba(139, 92, 246, 0.5);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --border-color: rgba(148, 163, 184, 0.1);
    --border-focus: rgba(139, 92, 246, 0.5);

    /* Spacing & Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Effects */
    --shadow-main: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Abstract background shapes */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.15) 0%, transparent 40%);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

.text-gradient {
    background: linear-gradient(to right, #c084fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Components: Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-main);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.6s ease-out;
}

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

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

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* Components: Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Links */
.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.link:hover {
    text-decoration: underline;
}

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

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

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Dashboard Specifics */
.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.nav-item {
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(15, 23, 42, 0.3);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.prediction-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Profile Dropdown Styles */
.profile-container {
    position: relative;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.profile-container:hover {
    background: rgba(255, 255, 255, 0.03);
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 100;
    margin-top: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

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

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

.profile-container:hover .profile-dropdown {
    display: flex;
}

.dropdown-header {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.dropdown-header strong {
    color: var(--text-main);
}

.dropdown-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.1);
    /* Primary tint */
    color: var(--text-main);
}

.dropdown-item svg {
    opacity: 0.7;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-main);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Default: Hide Mobile Top Bar on Desktop */
.mobile-top-bar {
    display: none;
}

/* Responsive Design */
@media (max-width: 900px) {
    #view-dashboard {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {

    /* Layout */
    .dashboard-container {
        flex-direction: column;
    }

    /* Mobile Top Bar */
    .mobile-top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 200;
        display: flex;
        align-items: center;
        padding: 0 1rem;
        border-bottom: 1px solid var(--border-color);
        gap: 1rem;
    }

    .mobile-top-bar #mobileMenuBtn {
        display: flex;
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 50%;
        color: var(--text-main);
        align-items: center;
        justify-content: center;
        /* Reset any previous styles */
        position: static;
        margin: 0;
    }

    /* Sidebar Off-canvas */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 260px;
        z-index: 300;
        /* Must be above top bar */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(0);
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
        padding-top: 1rem;
    }

    .sidebar.active {
        transform: translateX(280px);
    }

    #sidebarOverlay {
        z-index: 250;
        /* Between top bar and sidebar */
    }

    #sidebarOverlay.active {
        display: block !important;
    }

    /* Main Content Adjustments */
    .main-content {
        padding: 1.5rem;
        padding-top: 5.5rem;
        /* 64px (bar) + extra space */
    }

    /* Center Header Content on Mobile */
    .main-content header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-container {
        width: 100%;
        justify-content: center;
    }

    /* Grid Stacking */
    #view-dashboard {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Typography adjustment */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    /* Adjust Profile Dropdown for mobile (Bottom Sheet style) */
    .profile-dropdown {
        right: 0;
        left: 0;
        width: 100%;
        position: fixed;
        top: auto;
        bottom: 0;
        margin-top: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: slideUp 0.3s ease-out;
        z-index: 400;
        border-bottom: none;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    /* Hide large upload icon on super small screens to save space */
    .upload-zone svg {
        width: 40px;
        height: 40px;
    }

    .sidebar-close-btn {
        display: block !important;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
    }
}

.sidebar-close-btn {
    display: none;
}

/* Hidden on desktop */