:root {
    /* Premium Dark Theme Colors */
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 28, 0.6);
    --bg-card-hover: rgba(30, 30, 40, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --primary: #9d4edd;
    --primary-hover: #7b2cbf;
    --accent: #ff79c6;
    --border: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(157, 78, 221, 0.2);
    --success: #50fa7b;
    --error: #ff5555;
    
    --blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.portfolio-return {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(16, 12, 35, 0.78);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.portfolio-return:hover,
.portfolio-return:focus-visible {
    border-color: rgba(255, 107, 213, 0.55);
    background: rgba(35, 25, 70, 0.92);
    outline: none;
    transform: translateY(-2px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .season-name {
    font-family: 'Outfit', sans-serif;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 32px rgba(157, 78, 221, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(157, 78, 221, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

.btn-capture {
    background: white;
    color: black;
}

.btn-capture:hover {
    transform: scale(1.05);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Pulse animation */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(157, 78, 221, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(157, 78, 221, 0); }
    100% { box-shadow: 0 0 0 0 rgba(157, 78, 221, 0); }
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* Header Controls */
.lang-toggle {
    position: fixed;
    top: 1.5rem;
    right: 5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.lang-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
}

.settings-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.settings-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: rotate(30deg);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1001;
    width: 90%;
    max-width: 450px;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(157, 78, 221, 0.2);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 1rem;
}

.hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.hint a {
    color: var(--primary);
    text-decoration: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Sections */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Hero Section */
.hero {
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--primary);
    animation-delay: 0s;
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #4cc9f0;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.logo-mark {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #fff, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-desc {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.feature-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Section */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.section-desc {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.upload-area {
    margin-bottom: 3rem;
}

.drop-zone {
    background: rgba(20, 20, 28, 0.4);
    border: 2px dashed var(--border);
    border-radius: 32px;
    padding: 4rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(157, 78, 221, 0.1);
}

.drop-icon {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.drop-or {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.upload-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.camera-container, .preview-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    max-height: 600px;
    margin: 0 auto;
}

#camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

#preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.camera-controls, .preview-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.tips {
    margin-top: 2rem;
}

.tips h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.tips ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tips li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.tips li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-size: 1.5rem;
    line-height: 1;
}

/* Loading Section */
.loading-container {
    text-align: center;
    max-width: 400px;
}

.loading-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 3rem;
    position: relative;
}

.color-wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    animation: rotate 8s linear infinite;
}

.wheel-segment {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    transform: rotate(calc(45deg * var(--i, 0))) translateY(-50px);
    box-shadow: 0 0 20px var(--color);
    animation: pulse 1.5s ease-in-out infinite alternate;
    animation-delay: var(--delay);
}

.wheel-segment:nth-child(1) { --i: 0; }
.wheel-segment:nth-child(2) { --i: 1; }
.wheel-segment:nth-child(3) { --i: 2; }
.wheel-segment:nth-child(4) { --i: 3; }
.wheel-segment:nth-child(5) { --i: 4; }
.wheel-segment:nth-child(6) { --i: 5; }
.wheel-segment:nth-child(7) { --i: 6; }
.wheel-segment:nth-child(8) { --i: 7; }

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

@keyframes pulse {
    0% { transform: rotate(calc(45deg * var(--i, 0))) translateY(-40px) scale(0.8); opacity: 0.5; }
    100% { transform: rotate(calc(45deg * var(--i, 0))) translateY(-60px) scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.loading-sub {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.step {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step.active {
    background: rgba(157, 78, 221, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-glow);
    transform: scale(1.02);
}

/* Results Section */
#results-section .container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 4rem;
}

.season-card {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(20,20,28,0.8), rgba(30,30,40,0.8));
    border-top: 2px solid var(--primary);
}

.season-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.season-icon {
    font-size: 4rem;
    background: rgba(255,255,255,0.1);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.season-name {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary);
    text-shadow: 0 2px 10px rgba(157, 78, 221, 0.3);
}

.season-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.season-summary {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.result-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-content {
    font-size: 1.1rem;
    font-weight: 500;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.color-swatch {
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.2s ease;
}

.color-swatch:hover .color-circle {
    transform: scale(1.1);
}

.color-name {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.outfits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.outfit-card {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.outfit-name {
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.outfit-colors {
    display: flex;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
}

.outfit-color {
    flex: 1;
}

.makeup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .makeup-grid {
        grid-template-columns: 1fr;
    }
}

.makeup-item {
    margin-bottom: 1.5rem;
}

.makeup-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.makeup-val {
    font-weight: 500;
}

.hair-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.hair-color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
}

.celebrity-section {
    text-align: center;
    background: linear-gradient(45deg, rgba(20,20,28,0.8), rgba(157, 78, 221, 0.1));
}

.celebrity-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--error);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(255, 85, 85, 0.3);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.hidden {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* Utilities */
.btn-back {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

@media (max-width: 768px) {
    .hero-title { font-size: 3rem; }
    .season-name { font-size: 2rem; }
    .season-icon { width: 80px; height: 80px; font-size: 3rem; }
    .btn-back { top: 1rem; left: 1rem; }
    .container { padding: 1rem; }
}
