:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background Animated Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: #4F46E5;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #10B981;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-links a:not(.nav-cta):hover, .nav-links a.active:not(.nav-cta) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.nav-cta:hover, .nav-links a.active.nav-cta {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary)) !important;
}

/* Main Container */
.container {
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hidden-section {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
}

.active-section {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #fff;
}

h2 i {
    color: var(--primary);
}

/* Search Area */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

input[type="text"] {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-success {
    background: var(--secondary);
    color: #fff;
}
.btn-success:hover {
    background: #0ea5e9; /* Or slightly darker green */
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}
.btn-icon:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

/* Tooltip */
.tooltip {
    position: relative;
}
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.tooltip:hover::after {
    opacity: 1;
}

/* Results Card */
.result-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.result-row:last-child {
    border-bottom: none;
}

.label {
    color: var(--text-muted);
    font-weight: 500;
}
.value {
    font-weight: 600;
    color: #fff;
}
.highlight {
    color: var(--secondary);
}

.hidden {
    display: none !important;
}

.error-msg {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Design Process Section */
.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.panel-side {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.panel-side h3 {
    margin-bottom: 0.5rem;
    color: #fff;
}
.desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}
.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}
.upload-zone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.upload-zone p {
    color: var(--text-muted);
}

/* Status Card */
.status-card {
    margin-top: 2rem;
}
.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin-left: 1rem;
}
.badge.processing { background: #f59e0b; color: #fff; }
.badge.designing { background: var(--primary); color: #fff; }
.badge.waiting { background: #8b5cf6; color: #fff; }
.badge.completed { background: var(--secondary); color: #fff; }

/* Timer */
.countdown {
    margin-top: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.timer {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--secondary);
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Preview Actions */
.preview-actions {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Admin Controls */
.admin-controls.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.control-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.control-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.control-group input[type="number"], .control-group input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: #fff;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .split-view {
        grid-template-columns: 1fr;
    }
    .search-container {
        flex-direction: column;
    }
    
    /* Navbar Mobile */
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem 5%;
    }
    .menu-toggle {
        display: block;
    }

    .navbar {
        position: relative;
    }
    .nav-links {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 0;
        background: rgba(15, 23, 42, 0.98);
        padding: 1rem;
        border-radius: 0 0 12px 12px;
        border: 1px solid var(--border);
        border-top: none;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links a {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    /* Typography Mobile */
    h1 {
        font-size: 2.2rem !important;
    }
    
    /* Layout Mobile */
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    .glass-panel {
        padding: 1.5rem;
    }
    
    /* Hero Banner Mobile Fixes */
    #home-section > div > div {
        min-width: 100% !important;
    }
    
    /* Dashboard Header */
    #dashboard-section > div:first-child {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
    }
    #dashboard-section > div:first-child > div {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
    }
    
    /* Chat Modal Full Screen on Mobile */
    #chat-modal > div {
        width: 95% !important;
        height: 90vh !important;
        max-height: none !important;
    }
    
    /* Project Cards Mobile */
    .project-card {
        padding: 1rem;
    }
    .project-card > div:last-child {
        flex-direction: column !important;
    }
    .project-card .btn-primary, .project-card .btn-secondary, .project-card .btn-success {
        width: 100%;
    }
}

/* TOAST NOTIFICATION */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--secondary);
}

.toast.success i {
    color: var(--secondary);
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.error i {
    color: #ef4444;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}
