/* ==========================================================================
   DISEÑO BASE Y VARIABLES
   ========================================================================== */
:root {
    --bg-dark: #090c15;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Paleta Happy: Rosas, Rojos y Dorados */
    --happy-primary: #ff4b72;
    --happy-secondary: #ffb834;
    --happy-glow: rgba(255, 75, 114, 0.35);
    --happy-bg: linear-gradient(135deg, rgba(255, 75, 114, 0.15) 0%, rgba(255, 184, 52, 0.1) 100%);
    --happy-card-bg: linear-gradient(135deg, rgba(255, 75, 114, 0.18) 0%, rgba(255, 184, 52, 0.12) 100%);

    /* Paleta Bother: Morados, Indigos y Ámbar */
    --bother-primary: #a855f7;
    --bother-secondary: #f97316;
    --bother-glow: rgba(168, 85, 247, 0.35);
    --bother-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(249, 115, 22, 0.1) 100%);
    --bother-card-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(249, 115, 22, 0.12) 100%);

    /* Otros Colores */
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --border-glow: rgba(255, 255, 255, 0.15);
}

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

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

/* Fondo decorativo con luces difusas (Glow) */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 10% 20%, rgba(255, 75, 114, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

/* Partículas flotantes de fondo */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   COMPONENTES GENÉRICOS (GLASSMORPHISM)
   ========================================================================== */
.glass-panel {
    background: rgba(20, 25, 45, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Botones */
.btn {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--happy-primary) 0%, #ff6b8b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 75, 114, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 75, 114, 0.5);
}

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

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

.btn-link {
    background: transparent;
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 0.5rem;
}

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

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(45deg);
}

/* ==========================================================================
   ESTRUCTURA DE PANTALLAS
   ========================================================================== */
.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* ==========================================================================
   PANTALLA 1: ONBOARDING / CONFIGURACIÓN / SELECCIÓN DE PERFIL
   ========================================================================== */
#onboarding-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.onboarding-card {
    max-width: 550px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: scale-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-card h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--happy-primary) 0%, var(--bother-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-card p.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Formulario nombres */
.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: var(--happy-primary);
    box-shadow: 0 0 10px rgba(255, 75, 114, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* Selector de Perfil */
#profile-selector h2, #setup-names-form h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.profile-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.profile-card {
    flex: 1;
    max-width: 180px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.avatar {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
}

.avatar-1 {
    background: linear-gradient(135deg, rgba(255, 75, 114, 0.2) 0%, rgba(255, 184, 52, 0.1) 100%);
    border: 2px solid var(--happy-primary);
}

.avatar-2 {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(249, 115, 22, 0.1) 100%);
    border: 2px solid var(--bother-primary);
}

.profile-card:hover .avatar {
    transform: scale(1.1) rotate(5deg);
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* ==========================================================================
   PANTALLA 2: APP PRINCIPAL
   ========================================================================== */
/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(9, 12, 21, 0.8);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 800;
}

.logo-text p.header-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-status-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem 0.4rem 0.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.active-avatar {
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==========================================================================
   DASHBOARD / DECK DE CARTAS (DOS GRUPOS)
   ========================================================================== */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.dashboard-section {
    display: none;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.dashboard-section.active {
    display: flex;
}

.decks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 900px;
    margin: auto;
}

.deck-card {
    height: 380px;
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(20, 25, 45, 0.5);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: opacity 0.5s;
    opacity: 0.05;
}

.deck-happy::after {
    background: linear-gradient(135deg, var(--happy-primary) 0%, var(--happy-secondary) 100%);
}

.deck-bother::after {
    background: linear-gradient(135deg, var(--bother-primary) 0%, var(--bother-secondary) 100%);
}

/* Brillo en hover */
.deck-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    pointer-events: none;
    z-index: 0;
}

.deck-happy .deck-glow {
    background: var(--happy-primary);
    top: 0;
    right: 0;
}

.deck-bother .deck-glow {
    background: var(--bother-primary);
    top: 0;
    right: 0;
}

/* Contenido del Deck */
.deck-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 1rem;
}

.deck-icon {
    font-size: 4rem;
    margin-bottom: auto;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.deck-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.deck-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.deck-action {
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.deck-happy .deck-action { color: var(--happy-primary); }
.deck-bother .deck-action { color: var(--bother-primary); }

/* Hover Effects */
.deck-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.deck-card:hover::after {
    opacity: 0.15;
}

.deck-card:hover .deck-glow {
    opacity: 0.4;
    transform: scale(1.5);
}

.deck-card:hover .deck-icon {
    transform: scale(1.2) rotate(5deg);
}

.deck-card:hover .deck-action {
    transform: translateX(5px);
}

/* ==========================================================================
   BADGES VIVIENTES (NOTIFICACIONES PULSANTES)
   ========================================================================== */
.deck-badge {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.deck-happy .deck-badge {
    background: var(--happy-primary);
    box-shadow: 0 0 15px var(--happy-primary);
}

.deck-bother .deck-badge {
    background: var(--bother-primary);
    box-shadow: 0 0 15px var(--bother-primary);
}

/* Notificación viviente animada (pulso de anillo externo) */
.pulsing-badge::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    opacity: 0.8;
    z-index: -1;
    animation: ring-pulse 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
}

.deck-happy .pulsing-badge::before {
    border: 2px solid var(--happy-primary);
}

.deck-bother .pulsing-badge::before {
    border: 2px solid var(--bother-primary);
}

/* Animación de pulso */
@keyframes ring-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Ocultar si el contador es 0 */
.deck-badge.zero {
    opacity: 0.3;
    animation: none;
    box-shadow: none;
}
.deck-badge.zero::before {
    display: none;
}

/* ==========================================================================
   VISTA DEL TABLERO DE NOTAS (WALL VIEW)
   ========================================================================== */
.wall-section {
    display: none;
    flex-direction: column;
    gap: 2rem;
    animation: fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.wall-section.active {
    display: flex;
}

.wall-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.wall-title-container h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.wall-title-container p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Controles de filtro */
.filter-controls {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.filter-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Grid de Notas */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
    align-items: start;
}

/* ==========================================================================
   INTERACCIÓN FLASHCARD 3D
   ========================================================================== */
.flashcard-container {
    perspective: 1200px;
    height: 280px;
    width: 100%;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* Clase para girar la tarjeta */
.flashcard.is-flipped {
    transform: rotateY(180deg);
}

/* Caras común */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

/* --- DORSO DE LA CARTA (BOCA ABAJO) --- */
.card-back {
    transform: rotateY(0deg);
    z-index: 2;
    background: rgba(20, 25, 45, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

/* Diseño decorativo interno para simular una carta misteriosa */
.card-back-pattern {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
    transition: transform 0.4s;
}

.flashcard-container.happy .card-back-pattern {
    background: linear-gradient(135deg, rgba(255, 75, 114, 0.15) 0%, rgba(255, 184, 52, 0.05) 100%);
    border: 1.5px dashed rgba(255, 75, 114, 0.4);
    color: var(--happy-primary);
}

.flashcard-container.bother .card-back-pattern {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    border: 1.5px dashed rgba(168, 85, 247, 0.4);
    color: var(--bother-primary);
}

.card-back h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-back p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.flashcard:hover .card-back-pattern {
    transform: scale(1.1) rotate(5deg);
}

.flashcard:hover .card-back {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* --- FRENTE DE LA CARTA (BOCA ARRIBA) --- */
.card-front {
    transform: rotateY(180deg);
    z-index: 1;
}

.flashcard-container.happy .card-front {
    background: var(--happy-card-bg);
    border-color: rgba(255, 75, 114, 0.25);
    box-shadow: 0 8px 25px rgba(255, 75, 114, 0.1);
}

.flashcard-container.bother .card-front {
    background: var(--bother-card-bg);
    border-color: rgba(168, 85, 247, 0.25);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.1);
}

/* Detalle de Cabecera de Nota */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.5rem;
}

.card-author {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-date {
    font-size: 0.75rem;
}

/* Cuerpo de la Nota */
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-primary);
}

/* Scrollbar sutil para la tarjeta */
.card-body::-webkit-scrollbar {
    width: 4px;
}
.card-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.card-note-emoji {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* Footer / Acciones del Frente */
.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sección de Reacciones */
.reaction-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.react-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.react-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.react-trigger.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Botón de Resolver */
.btn-resolve {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    width: 100%;
    padding: 0.4rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-resolve:hover {
    background: var(--accent-green);
    color: #000;
}

/* --- ESTADOS DE LA TARJETA --- */
/* Resuelta */
.flashcard-container.resolved .card-front {
    opacity: 0.55;
    filter: grayscale(40%);
}

.resolved-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    z-index: 3;
}

/* ==========================================================================
   ESTADO VACÍO (EMPTY STATE)
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 3.5rem;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   BOTÓN FLOTANTE (FAB) Y MODAL DE NUEVA NOTA
   ========================================================================== */
.fab-btn {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--happy-primary) 0%, var(--bother-primary) 100%);
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 400;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
}

/* Overlay del Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 12, 21, 0.6);
    backdrop-filter: blur(8px);
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    max-width: 550px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    animation: scale-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.8rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Formulario Modal */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

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

/* Selector de tipo en modal */
.type-selector {
    display: flex;
    gap: 1rem;
}

.type-option {
    flex: 1;
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.type-option input:checked + .type-box {
    border-width: 1.5px;
}

.option-happy input:checked + .type-box {
    border-color: var(--happy-primary);
    background: rgba(255, 75, 114, 0.08);
    box-shadow: 0 0 12px rgba(255, 75, 114, 0.2);
}

.option-bother input:checked + .type-box {
    border-color: var(--bother-primary);
    background: rgba(168, 85, 247, 0.08);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.type-emoji {
    font-size: 1.8rem;
}

/* Picker de Emojis */
.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.emoji-option {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-option.selected {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Área de Texto */
.form-group textarea {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    outline: none;
    resize: none;
    transition: all 0.3s;
}

.form-group textarea:focus {
    border-color: var(--happy-primary);
    background: rgba(255, 255, 255, 0.05);
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.1rem;
}

/* ==========================================================================
   ANIMACIONES GENERALES
   ========================================================================== */
@keyframes scale-up {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   CONFETI Y EFECTOS PARTICULARES
   ========================================================================== */
.confetti-particle {
    position: absolute;
    pointer-events: none;
    z-index: 100;
    border-radius: 50%;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 600px) {
    .app-header {
        padding: 1rem;
    }
    .app-main {
        padding: 1rem;
    }
    .decks-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .deck-card {
        height: 300px;
    }
    .deck-content {
        padding: 2rem 1.5rem;
    }
    .fab-btn {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    .modal-content {
        padding: 1.5rem;
    }
    .onboarding-card {
        padding: 2rem 1.5rem;
    }
    .profile-cards {
        flex-direction: column;
        align-items: center;
    }
    .profile-card {
        width: 100%;
        max-width: 250px;
    }
    .notes-grid {
        grid-template-columns: 1fr;
    }
}
