/**
 * SUNBURST AI STUDIO - ESTILOS PRINCIPALES
 * Diseño moderno, oscuro, responsivo y dinámico mediante variables CSS
 */

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

body {
    background-color: var(--color-bg, #0f1117);
    color: var(--color-text, #f1f5f9);
    font-family: var(--font-main, 'Inter', system-ui, -apple-system, sans-serif);
    font-size: var(--font-base-size, 16px);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary, #6366f1);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent, #8b5cf6);
}

/* NAVBAR */
.navbar {
    background: rgba(24, 27, 36, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border, #262a36);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
}

.brand-sparkle {
    color: #f59e0b;
    font-size: 1.35rem;
    text-shadow: 0 0 14px rgba(245, 158, 11, 0.65);
    display: inline-block;
}

.brand-typography {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #ffffff 40%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    font-family: var(--font-main, system-ui, sans-serif);
}

.brand-accent {
    margin-left: 3px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.brand-auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--color-text-muted, #94a3b8);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--border-radius, 10px);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary, #6366f1), var(--color-accent, #8b5cf6));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

.btn-secondary {
    background: var(--color-card, #181b24);
    color: var(--color-text, #f1f5f9);
    border: 1px solid var(--color-border, #262a36);
}

.btn-secondary:hover {
    background: #232734;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--color-text, #f1f5f9);
    border: 1px solid var(--color-border, #262a36);
}

.btn-outline:hover {
    border-color: var(--color-primary, #6366f1);
    color: var(--color-primary, #6366f1);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.badge-credits {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* CONTENEDOR PRINCIPAL */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* HERO SECTION (PORTADA) */
.hero {
    text-align: center;
    padding: 5rem 1.5rem;
    background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.15), transparent 70%);
}

.hero-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero h1 {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted, #94a3b8);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* CARDS & GRIDS */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.card {
    background: var(--color-card, #181b24);
    border: 1px solid var(--color-border, #262a36);
    border-radius: var(--border-radius, 12px);
    padding: 1.75rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.4);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.card p {
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.95rem;
}

/* STUDIO DE GENERACIÓN (ESTILO FIREFLY) */
.studio-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 70px);
}

.studio-sidebar {
    width: 380px;
    background: var(--color-card, #181b24);
    border-right: 1px solid var(--color-border, #262a36);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.studio-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 50%, rgba(24, 27, 36, 0.5), var(--color-bg, #0f1117));
}

.section-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #94a3b8);
    margin-bottom: 0.5rem;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.model-card-radio {
    display: block;
    position: relative;
    cursor: pointer;
}

.model-card-radio input {
    position: absolute;
    opacity: 0;
}

.model-card-box {
    background: #11131b;
    border: 1px solid var(--color-border, #262a36);
    border-radius: var(--border-radius, 10px);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.model-card-radio input:checked + .model-card-box {
    border-color: var(--color-primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 1px var(--color-primary, #6366f1);
}

.aspect-ratio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.ratio-btn {
    background: #11131b;
    border: 1px solid var(--color-border, #262a36);
    color: var(--color-text, #f1f5f9);
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ratio-btn.active, .ratio-btn:hover {
    border-color: var(--color-primary, #6366f1);
    background: rgba(99, 102, 241, 0.1);
}

.reference-upload-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ref-slot {
    aspect-ratio: 1;
    background: #11131b;
    border: 1px dashed var(--color-border, #262a36);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.75rem;
    transition: border-color 0.2s ease;
}

.ref-slot:hover {
    border-color: var(--color-primary, #6366f1);
    color: #ffffff;
}

.ref-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-slot .btn-remove-ref {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CAMPO DE PROMPT EN ESTUDIO */
.studio-prompt-container {
    width: 100%;
    max-width: 900px;
    background: var(--color-card, #181b24);
    border: 1px solid var(--color-border, #262a36);
    border-radius: var(--border-radius-lg, 16px);
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
}

.prompt-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    min-height: 90px;
    outline: none;
    line-height: 1.5;
}

.prompt-textarea::placeholder {
    color: #64748b;
}

.prompt-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* GALERÍA DE RESULTADOS */
.studio-gallery-grid {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    background: var(--color-card, #181b24);
    border: 1px solid var(--color-border, #262a36);
    border-radius: var(--border-radius, 12px);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

/* FORMULARIOS DE AUTENTICACIÓN */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 1.5rem;
    background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.12), transparent 70%);
}

.auth-card {
    background: var(--color-card, #181b24);
    border: 1px solid var(--color-border, #262a36);
    border-radius: var(--border-radius-lg, 16px);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.95rem;
}

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

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #e2e8f0;
}

.form-control {
    width: 100%;
    background: #11131b;
    border: 1px solid var(--color-border, #262a36);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius, 10px);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--color-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
}

.password-toggle-btn:hover {
    color: #ffffff;
}

/* ALERTAS */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius, 10px);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* FOOTER */
.footer {
    background: var(--color-card, #181b24);
    border-top: 1px solid var(--color-border, #262a36);
    padding: 2.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #ffffff;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .studio-layout {
        flex-direction: column;
    }
    .studio-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border, #262a36);
    }
    .hero h1 {
        font-size: 2.25rem;
    }
}
