/* ============================================
   ÉDGAR — Estilista Personal
   Sistema de Diseño Único
   ============================================ */

/* === VARIABLES Y CONFIGURACIÓN === */
:root {
    /* Paleta principal - Tonos arena y terracota */
    --color-sand-50: #faf8f5;
    --color-sand-100: #f5f0e8;
    --color-sand-200: #e8dfd0;
    --color-sand-300: #d4c4a8;
    --color-sand-400: #c2a87c;
    --color-sand-500: #b08d5b;
    
    /* Tonos profundos */
    --color-deep-900: #1a1612;
    --color-deep-800: #2a241e;
    --color-deep-700: #3d352c;
    --color-deep-600: #524840;
    
    /* Acento cobrizo */
    --color-copper-400: #d4a574;
    --color-copper-500: #c4956a;
    --color-copper-600: #a67c52;
    
    /* Fondos */
    --bg-primary: #fcfaf7;
    --bg-secondary: #f7f3ed;
    --bg-panel: rgba(255, 253, 250, 0.85);
    --bg-card: #ffffff;
    --bg-dark: var(--color-deep-900);
    
    /* Textos */
    --text-primary: var(--color-deep-900);
    --text-secondary: #6b5e52;
    --text-muted: #9a8b7a;
    --text-light: var(--color-sand-50);
    
    /* Bordes */
    --border-light: rgba(180, 160, 130, 0.2);
    --border-medium: rgba(180, 160, 130, 0.35);
    --border-accent: var(--color-copper-400);
    
    /* Sombras orgánicas */
    --shadow-subtle: 0 2px 8px rgba(26, 22, 18, 0.04);
    --shadow-soft: 0 4px 20px rgba(26, 22, 18, 0.08);
    --shadow-medium: 0 8px 32px rgba(26, 22, 18, 0.12);
    --shadow-lifted: 0 16px 48px rgba(26, 22, 18, 0.16);
    --shadow-glow: 0 0 40px rgba(196, 149, 106, 0.25);
    
    /* Tipografía */
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Espaciado */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Radios */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transiciones */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 200ms;
    --duration-normal: 350ms;
    --duration-slow: 500ms;
    
    /* Z-index */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 500;
    --z-toast: 600;
    --z-loader: 700;
}

/* === RESET Y BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Textura sutil de fondo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: -1;
}

.hidden {
    display: none !important;
}

/* === LOADER === */
.loader {
    position: fixed;
    inset: 0;
    background: var(--color-deep-900);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loader);
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader__inner {
    text-align: center;
}

.loader__brand {
    display: flex;
    gap: 0.15em;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    margin-bottom: var(--space-xl);
}

.loader__letter {
    color: var(--color-copper-400);
    opacity: 0;
    transform: translateY(30px);
    animation: letterReveal 0.6s var(--ease-out-expo) forwards;
}

.loader__letter:nth-child(1) { animation-delay: 0.1s; }
.loader__letter:nth-child(2) { animation-delay: 0.2s; }
.loader__letter:nth-child(3) { animation-delay: 0.3s; }
.loader__letter:nth-child(4) { animation-delay: 0.4s; }
.loader__letter:nth-child(5) { animation-delay: 0.5s; }

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

.loader__line {
    width: 120px;
    height: 1px;
    margin: 0 auto var(--space-lg);
    background: var(--color-copper-400);
    transform: scaleX(0);
    animation: lineExpand 1s var(--ease-out-expo) 0.8s forwards;
}

@keyframes lineExpand {
    to { transform: scaleX(1); }
}

.loader__tagline {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--color-sand-300);
    opacity: 0;
    animation: fadeIn 0.8s ease 1.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* === APP CONTAINER === */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: rgba(252, 250, 247, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.brand__icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-deep-900);
    color: var(--color-copper-400);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.header__brand:hover .brand__icon {
    transform: scale(1.05) rotate(-3deg);
}

.brand__text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.15em;
}

.header__nav {
    display: flex;
    gap: var(--space-sm);
}

.nav__btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.nav__btn svg {
    width: 22px;
    height: 22px;
}

.nav__btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

/* === MAIN LAYOUT === */
.main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(360px, 480px) 1fr;
    min-height: 0;
}

@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
}

/* === PANEL CONFIGURADOR === */
.panel--config {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    max-height: calc(100vh - 73px);
}

@media (max-width: 1024px) {
    .panel--config {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}

.panel__content {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* === SECCIONES DE CONFIGURACIÓN === */
.config-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.section__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.section__number {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-copper-500);
    letter-spacing: 0.05em;
}

.section__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* === GRID DE EVENTOS === */
.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

@media (max-width: 480px) {
    .event-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.event-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.event-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.event-card__icon svg {
    width: 28px;
    height: 28px;
}

.event-card__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.event-card__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.event-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.event-card:hover .event-card__icon {
    color: var(--color-copper-500);
    transform: scale(1.1);
}

.event-card.active {
    background: var(--color-deep-900);
    border-color: var(--color-deep-900);
    box-shadow: var(--shadow-medium);
}

.event-card.active .event-card__icon {
    color: var(--color-copper-400);
}

.event-card.active .event-card__label {
    color: var(--text-light);
}

.event-card.active .event-card__desc {
    color: var(--color-sand-300);
}

/* === SELECTOR CÓDIGO DE VESTIMENTA === */
.dress-code-selector {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
}

.dress-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.dress-btn__indicator {
    width: 8px;
    height: 8px;
    background: var(--border-medium);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.dress-btn__text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color var(--duration-fast);
}

.dress-btn:hover .dress-btn__text {
    color: var(--text-primary);
}

.dress-btn.active {
    background: var(--color-deep-900);
}

.dress-btn.active .dress-btn__indicator {
    background: var(--color-copper-400);
    box-shadow: 0 0 8px var(--color-copper-400);
}

.dress-btn.active .dress-btn__text {
    color: var(--text-light);
}

/* === TAGS DE ESTILO === */
.style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.style-tag {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.style-tag:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.style-tag.active {
    background: var(--color-deep-900);
    border-color: var(--color-deep-900);
    color: var(--color-copper-400);
}

/* === PALETA DE COLORES === */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.color-swatch {
    width: 48px;
    height: 48px;
    padding: 3px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.color-swatch .swatch {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--radius-md) - 4px);
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-soft);
}

.color-swatch.active {
    border-color: var(--color-deep-900);
    box-shadow: var(--shadow-medium);
    transform: scale(1.05);
}

/* === SECCIÓN COLAPSABLE === */
.config-section--collapsible {
    gap: 0;
}

.section__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity var(--duration-fast);
}

.section__toggle:hover {
    opacity: 0.8;
}

.toggle__icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.section__toggle.active .toggle__icon {
    transform: rotate(180deg);
}

.section__collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-out-expo);
}

.section__collapsible.open {
    max-height: 400px;
}

.advanced-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
}

.advanced-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.field__label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.field__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.field-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.field-btn:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.field-btn.active {
    background: var(--color-deep-800);
    border-color: var(--color-deep-800);
    color: var(--color-copper-400);
}

/* === BOTÓN GENERAR === */
.config-action {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.btn-generate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--color-deep-900);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.btn-generate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(196, 149, 106, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-generate:hover::before {
    transform: translateX(100%);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lifted);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate__text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-sand-100);
    letter-spacing: 0.05em;
}

.btn-generate__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-copper-500);
    border-radius: 50%;
    color: var(--color-deep-900);
    transition: transform var(--duration-normal) var(--ease-out-back);
}

.btn-generate__icon svg {
    width: 16px;
    height: 16px;
}

.btn-generate:hover .btn-generate__icon {
    transform: translateX(4px);
}

/* === PANEL PREVIEW === */
.panel--preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: linear-gradient(160deg, var(--bg-secondary) 0%, var(--color-sand-100) 100%);
    min-height: 500px;
}

@media (max-width: 1024px) {
    .panel--preview {
        min-height: 60vh;
    }
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

/* Esquinas decorativas */
.corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-copper-400);
}

.corner--tl {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
}

.corner--tr {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
}

.corner--bl {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
}

.corner--br {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
}

/* === ESTADOS DEL PREVIEW === */
.preview-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--duration-normal) ease, visibility var(--duration-normal);
}

.preview-state.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Estado inicial: Silueta */
.silhouette-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.silhouette-wrapper:hover {
    transform: scale(1.02);
}

.silhouette {
    position: relative;
    width: 180px;
    height: 340px;
}

.silhouette__svg {
    width: 100%;
    height: 100%;
}

.silhouette__part {
    fill: none;
    stroke: var(--border-medium);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    transition: all var(--duration-normal) ease;
}

.silhouette-wrapper:hover .silhouette__part {
    stroke: var(--color-copper-400);
    stroke-dasharray: none;
}

.silhouette__glow {
    position: absolute;
    inset: 20%;
    background: radial-gradient(ellipse at center, rgba(196, 149, 106, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.silhouette-wrapper:hover .silhouette__glow {
    opacity: 1;
}

.upload-prompt {
    text-align: center;
    margin-top: var(--space-lg);
}

.upload-prompt__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-medium);
    border-radius: 50%;
    color: var(--color-copper-500);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.upload-prompt__icon svg {
    width: 24px;
    height: 24px;
}

.silhouette-wrapper:hover .upload-prompt__icon {
    background: var(--color-copper-400);
    border-style: solid;
    border-color: var(--color-copper-400);
    color: var(--color-deep-900);
    transform: scale(1.1);
}

.upload-prompt__text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.upload-prompt__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Estado: Foto cargada */
.photo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 22, 18, 0.8);
    border: none;
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.photo-remove svg {
    width: 18px;
    height: 18px;
}

.photo-remove:hover {
    background: var(--color-deep-900);
    transform: scale(1.1);
}

/* Estado: Loading */
.generation-loader {
    text-align: center;
    padding: var(--space-xl);
}

.loader-fabric {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Círculo exterior pulsante */
.loader-fabric::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--color-copper-400);
    opacity: 0.3;
    animation: pulseRing 2s ease-out infinite;
}

.loader-fabric::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 2px dashed var(--color-copper-500);
    animation: rotateRing 8s linear infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

@keyframes rotateRing {
    to { transform: rotate(360deg); }
}

.fabric-thread {
    position: absolute;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-copper-400), transparent);
    border-radius: var(--radius-full);
    transform-origin: center center;
}

.fabric-thread:nth-child(1) {
    animation: threadSpin 1.5s ease-in-out infinite;
}

.fabric-thread:nth-child(2) {
    animation: threadSpin 1.5s ease-in-out 0.5s infinite;
    transform: rotate(60deg);
}

.fabric-thread:nth-child(3) {
    animation: threadSpin 1.5s ease-in-out 1s infinite;
    transform: rotate(120deg);
}

@keyframes threadSpin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 1;
    }
}

/* Icono central animado */
.loader-icon {
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 2;
    animation: iconPulse 2s ease-in-out infinite;
}

.loader-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--color-copper-400);
    stroke-width: 1.5;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.loader-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    min-height: 1.5em;
    animation: textFade 0.5s ease;
}

@keyframes textFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.loader-progress {
    width: 220px;
    height: 4px;
    margin: 0 auto;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.loader-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(196, 149, 106, 0.3), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-copper-500), var(--color-copper-400));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Etapas de carga */
.loader-stages {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.loader-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.loader-stage.active {
    opacity: 1;
}

.loader-stage.completed {
    opacity: 0.6;
}

.loader-stage.completed .stage-icon {
    background: var(--color-copper-400);
    color: white;
}

.stage-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-copper-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--color-copper-400);
    transition: all 0.3s ease;
}

.loader-stage.active .stage-icon {
    animation: stageActive 1s ease-in-out infinite;
}

@keyframes stageActive {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stage-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Resultado: Showcase */
.result-showcase {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.loader-progress {
    width: 200px;
    height: 3px;
    margin: 0 auto;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-copper-400);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Estado: Resultado */
.result-showcase {
    position: relative;
    width: 100%;
    height: 100%;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-actions {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(26, 22, 18, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
}

.result-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.result-btn svg {
    width: 20px;
    height: 20px;
}

.result-btn:hover {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: var(--color-deep-900);
}

.result-btn--primary {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: var(--color-deep-900);
}

.result-btn--primary:hover {
    background: var(--color-copper-400);
    border-color: var(--color-copper-400);
    transform: scale(1.05);
}

/* === LOOK INFO === */
.look-info {
    margin-top: var(--space-xl);
    text-align: center;
    max-width: 400px;
}

.look-info__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.look-info__desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.look-info__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
}

.look-tag {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === FOOTER === */
.footer {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer__text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* === MODAL === */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    transition: opacity var(--duration-normal), visibility var(--duration-normal);
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 22, 18, 0.6);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lifted);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.modal:not(.hidden) .modal__content {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

.modal__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.modal__close svg {
    width: 20px;
    height: 20px;
}

.modal__close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal__body {
    padding: var(--space-xl);
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.profile-section {
    margin-bottom: var(--space-xl);
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.profile-form {
    display: grid;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--duration-fast);
}

.form-group select:focus {
    outline: none;
    border-color: var(--color-copper-400);
}

.saved-looks {
    min-height: 100px;
}

.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === TOAST === */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-deep-900);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lifted);
    transform: translateX(120%);
    animation: toastSlideIn var(--duration-normal) var(--ease-out-expo) forwards;
}

.toast.removing {
    animation: toastSlideOut var(--duration-normal) var(--ease-out-expo) forwards;
}

@keyframes toastSlideIn {
    to { transform: translateX(0); }
}

@keyframes toastSlideOut {
    to { transform: translateX(120%); }
}

.toast--success {
    border-left: 3px solid #4ade80;
}

.toast--error {
    border-left: 3px solid #f87171;
}

.toast--info {
    border-left: 3px solid var(--color-copper-400);
}

/* === SCROLLBAR PERSONALIZADO === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === UTILIDADES === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === PANEL DE DETALLES DEL OUTFIT === */
.outfit-details {
    width: 100%;
    max-width: 500px;
    margin-top: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.outfit-details__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.outfit-details__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.outfit-details__toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.outfit-details__toggle svg {
    width: 20px;
    height: 20px;
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.outfit-details__toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.outfit-details__toggle.collapsed svg {
    transform: rotate(-90deg);
}

.outfit-details__content {
    padding: var(--space-lg);
    max-height: 500px;
    overflow-y: auto;
    transition: max-height var(--duration-slow) var(--ease-out-expo),
                padding var(--duration-slow) var(--ease-out-expo),
                opacity var(--duration-normal);
}

.outfit-details__content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* Lista de prendas */
.outfit-items {
    list-style: none;
    margin-bottom: var(--space-lg);
}

.outfit-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}

.outfit-item:hover {
    background: var(--bg-secondary);
}

.outfit-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--color-copper-500);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.outfit-item__info {
    flex: 1;
    min-width: 0;
}

.outfit-item__name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.outfit-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.outfit-item__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.outfit-item__color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
}

/* Explicación del outfit */
.outfit-reasoning {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.outfit-reasoning__title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-copper-600);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.outfit-reasoning__title::before {
    content: '✦';
    font-size: 0.8rem;
}

.outfit-reasoning__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.outfit-reasoning__text p {
    margin-bottom: var(--space-sm);
}

.outfit-reasoning__text p:last-child {
    margin-bottom: 0;
}

/* Botones de variación */
.outfit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.btn-variation {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.btn-variation svg {
    width: 16px;
    height: 16px;
}

.btn-variation:hover {
    background: var(--color-deep-900);
    border-color: var(--color-deep-900);
    color: var(--color-copper-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* === MEJORAS AL RESULTADO === */
.result-showcase {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.result-actions {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(26, 22, 18, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.preview-state--result:hover .result-actions {
    opacity: 1;
}

.result-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.result-btn svg {
    width: 20px;
    height: 20px;
}

.result-btn:hover {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: var(--color-deep-900);
    transform: scale(1.05);
}

.result-btn.active {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: white;
}

.result-btn.active svg {
    fill: currentColor;
}

.result-actions--secondary {
    opacity: 0.7;
}

/* === LOOK INFO MEJORADO === */
.look-info {
    width: 100%;
    max-width: 500px;
    margin-top: var(--space-xl);
    text-align: center;
    animation: fadeSlideUp 0.5s var(--ease-out-expo);
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.look-info__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.look-info__desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.look-info__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
}

.look-tag {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === PANEL PREVIEW RESPONSIVE === */
@media (max-width: 1024px) {
    .panel--preview {
        padding: var(--space-lg);
        min-height: auto;
    }
    
    .preview-container {
        max-width: 100%;
        aspect-ratio: auto;
        min-height: 400px;
    }
    
    .outfit-details {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .outfit-actions {
        flex-direction: column;
    }
    
    .btn-variation {
        justify-content: center;
    }
    
    .look-info__title {
        font-size: 1.4rem;
    }
}

/* ============================================
   SECCIÓN: IMAGE GALLERY - Historial y Galería
   (#16, #17, #19, #24, #25, #26, #27)
   ============================================ */

/* === BOTONES DE GALERÍA === */
.gallery-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.gallery-btn:hover {
    background: var(--bg-card);
    border-color: var(--color-copper-400);
    color: var(--color-copper-500);
}

.gallery-btn.active {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: white;
}

.gallery-btn svg {
    width: 16px;
    height: 16px;
}

/* === MODAL GALERÍA === */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 22, 18, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-lg);
    overflow-y: auto;
}

.gallery-modal-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--color-deep-800);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-modal-content.gallery-full {
    padding: var(--space-xl);
}

.gallery-modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--duration-fast);
    z-index: 10;
}

.gallery-modal-close:hover {
    background: var(--color-copper-500);
    transform: scale(1.1);
}

/* Header de galería */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.gallery-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

/* Tabs de galería (Todos / Favoritos) */
.gallery-tabs {
    display: flex;
    gap: var(--space-sm);
}

.gallery-tab {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.gallery-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.gallery-tab.active {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: var(--text-light);
}

/* Footer de galería */
.gallery-footer {
    display: flex;
    justify-content: center;
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-btn {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.gallery-btn-danger {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ff6b7a;
}

.gallery-btn-danger:hover {
    background: rgba(220, 53, 69, 0.4);
}

/* Grid de galería */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--color-copper-500);
    border-radius: 3px;
}

/* Items de galería dinámicos */
.gallery-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-item-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-normal);
}

.gallery-item-image:hover img {
    transform: scale(1.05);
}

.gallery-item-fav {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 1.2rem;
}

.gallery-item-info {
    padding: var(--space-md);
    flex: 1;
}

.gallery-item-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 var(--space-xs) 0;
}

.gallery-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-xs) 0;
}

.gallery-item-items,
.gallery-item-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item-note {
    color: var(--color-copper-400);
    font-style: italic;
    margin-top: var(--space-xs);
}

/* Acciones de item de galería */
.gallery-item-actions {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-action-btn {
    flex: 1;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.gallery-action-btn:hover {
    background: var(--color-copper-500);
    transform: translateY(-2px);
}

.gallery-action-delete:hover {
    background: rgba(220, 53, 69, 0.8);
}

/* Controles de zoom */
.zoom-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.zoom-btn:hover {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
}

.zoom-controls {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(26, 22, 18, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Editor de notas */
.note-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--z-modal) + 20);
    padding: var(--space-lg);
}

.note-editor {
    width: 100%;
    max-width: 500px;
    background: var(--color-deep-800);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.note-editor h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-light);
    margin: 0 0 var(--space-md) 0;
}

.note-editor textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: vertical;
}

.note-editor textarea:focus {
    outline: none;
    border-color: var(--color-copper-500);
}

.note-editor-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-md);
}

.note-btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.note-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.note-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.note-btn-save {
    background: var(--color-copper-500);
    color: var(--text-light);
}

.note-btn-save:hover {
    background: var(--color-copper-400);
}

/* === COMPARADOR ANTES/DESPUÉS (#24) === */
.compare-modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 22, 18, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-xl);
}

.compare-modal__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
}

.compare-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-deep-800);
}

.compare-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.compare-image--before {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.compare-image--after {
    z-index: 1;
}

.compare-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--color-copper-500);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.compare-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--color-copper-500);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-medium);
}

.compare-slider::after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: white;
}

.compare-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin-top: var(--space-md);
}

.compare-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compare-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.compare-close:hover {
    background: var(--color-copper-500);
}

/* === ANOTACIONES (#27) === */
.note-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 22, 18, 0.95);
    backdrop-filter: blur(8px);
    padding: var(--space-lg);
    transform: translateY(100%);
    transition: transform var(--duration-normal) var(--ease-out-expo);
}

.note-panel.open {
    transform: translateY(0);
}

.note-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.note-panel__title {
    font-weight: 600;
    color: var(--text-light);
}

.note-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-light);
    resize: vertical;
}

.note-textarea::placeholder {
    color: var(--text-muted);
}

.note-textarea:focus {
    outline: none;
    border-color: var(--color-copper-400);
}

.note-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* === BOTÓN DE CANCELAR GENERACIÓN (#15) === */
.cancel-generation-btn {
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(220, 53, 69, 0.9);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--duration-fast);
    animation: pulseCancel 2s infinite;
}

.cancel-generation-btn:hover {
    background: rgb(220, 53, 69);
    transform: translateX(-50%) scale(1.05);
}

@keyframes pulseCancel {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* === BADGE DE OFFLINE === */
.offline-badge {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 193, 7, 0.9);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-deep-900);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    z-index: var(--z-toast);
    animation: slideInRight 0.3s var(--ease-out-expo);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === HISTORIAL RÁPIDO EN SIDEBAR === */
.history-preview {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
}

.history-preview__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.history-preview__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.history-preview__item {
    aspect-ratio: 2/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--duration-fast);
}

.history-preview__item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.history-preview__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === COMPARTIR (#19) === */
.share-menu {
    position: absolute;
    bottom: calc(100% + var(--space-sm));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    box-shadow: var(--shadow-lifted);
    display: flex;
    gap: var(--space-xs);
    z-index: 10;
}

.share-option {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.share-option:hover {
    background: var(--color-copper-500);
    border-color: var(--color-copper-500);
    color: white;
}

.share-option svg {
    width: 20px;
    height: 20px;
}

/* === ESTADO VACÍO DE GALERÍA === */
.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-3xl);
}

.gallery-empty__icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
}

.gallery-empty__text {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

/* === RESPONSIVE GALERÍA === */
@media (max-width: 768px) {
    .gallery-modal {
        padding: var(--space-md);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .gallery-modal__title {
        font-size: 1.4rem;
    }
    
    .compare-container {
        max-width: 100%;
    }
    
    .zoom-modal__controls {
        bottom: var(--space-md);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-tabs {
        flex-wrap: wrap;
    }
    
    .gallery-tab {
        flex: 1;
        text-align: center;
    }
}

/* ============================================
   SECCIÓN: PERFIL - Historial y Favoritos
   ============================================ */

.profile-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.profile-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.profile-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.profile-section__header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-text {
    background: none;
    border: none;
    color: var(--color-copper-500);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}

.btn-text:hover {
    background: rgba(196, 149, 106, 0.1);
    color: var(--color-copper-600);
}

/* Grid de historial/favoritos en perfil */
.history-grid,
.favorites-grid,
.saved-looks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.history-grid .empty-state,
.favorites-grid .empty-state,
.saved-looks .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Items del grid de perfil */
.profile-look-item {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.profile-look-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.profile-look-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-look-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-fast);
    display: flex;
    align-items: flex-end;
    padding: var(--space-sm);
}

.profile-look-item:hover .profile-look-item__overlay {
    opacity: 1;
}

.profile-look-item__title {
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Indicador de favorito en perfil */
.profile-look-item__fav {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    font-size: 0.8rem;
}

/* Sección de peligro (borrar datos) */
.profile-section--danger {
    background: rgba(220, 53, 69, 0.05);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
}

.profile-section--danger h3 {
    color: #dc3545;
}

.text-muted {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.btn--danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn--danger:hover {
    background: #dc3545;
    color: white;
}

.btn--outline {
    background: transparent;
    border: 1px solid currentColor;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
}

/* Responsive del perfil */
@media (max-width: 768px) {
    .history-grid,
    .favorites-grid,
    .saved-looks {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .history-grid,
    .favorites-grid,
    .saved-looks {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
}
