:root {
    --primary-color: #6366f1;
    --secondary-color: #a855f7;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: #a5b4fc;
    /* Lighter indigo for better contrast on dark bg */
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Gruppo', sans-serif;
    letter-spacing: 1px;
    color: goldenrod;
}

.navbar-brand {
    font-family: 'Gruppo', sans-serif;
    letter-spacing: 1px;
    color: var(--text-main);
}

.text-light-50 {
    color: var(--text-muted);
}

/* Glassmorphism Components */
.glass-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.btn-glass {
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* App Interface */
.main-container {
    padding-top: 3rem;
}

.visual-area {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    margin: 1rem;
    overflow: hidden;
    position: relative;
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-placeholder:hover,
.upload-placeholder.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-main);
}

#mainImage,
#webcamVideo {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
}

#overlayCanvas {
    pointer-events: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.loading-text {
    font-family: 'Gruppo', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-top: 1rem;
    animation: pulse 2s infinite;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 41, 59, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

.toast-notification.success {
    border-color: #22c55e;
    color: #86efac;
}

.toast-notification.error {
    border-color: #ef4444;
    color: #fca5a5;
}

.toast-notification.warning {
    border-color: #eab308;
    color: #fde047;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Accordion Overrides */
.accordion-button {
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.accordion-button::after {
    filter: invert(1);
}

/* Responsive */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }

    .visual-area {
        min-height: 300px;
    }
}