/* =====================================================
   CSS MODERNO PARA CRIANÇAS - DRC01
   Design alegre, colorido e intuitivo
   ===================================================== */

/* Animações Divertidas */
@keyframes bounce-in {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4); }
}

@keyframes rainbow-border {
    0% { border-color: #ff6b6b; }
    16% { border-color: #feca57; }
    33% { border-color: #48dbfb; }
    50% { border-color: #1dd1a1; }
    66% { border-color: #5f27cd; }
    83% { border-color: #ff9ff3; }
    100% { border-color: #ff6b6b; }
}

@keyframes float-up-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes slide-in-right {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Variáveis CSS para Cores Alegres */
:root {
    /* Cores Primárias - Vibrantes e Alegres */
    --color-primary: #667eea;
    --color-primary-light: #818cf8;
    --color-primary-dark: #4f46e5;
    
    /* Cores do Arco-íris para Módulos */
    --color-red: #ff6b6b;
    --color-orange: #feca57;
    --color-yellow: #f9ca24;
    --color-green: #1dd1a1;
    --color-blue: #48dbfb;
    --color-purple: #5f27cd;
    --color-pink: #ff9ff3;
    
    /* Cores de Feedback */
    --color-success: #00d26a;
    --color-warning: #ffc107;
    --color-error: #ff5252;
    --color-info: #2196f3;
    
    /* Cores Neutras */
    --color-white: #ffffff;
    --color-light: #f8f9ff;
    --color-gray: #94a3b8;
    --color-dark: #1e293b;
    
    /* Gradientes Mágicos */
    --gradient-magic: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    --gradient-ocean: linear-gradient(135deg, #48dbfb 0%, #667eea 100%);
    --gradient-forest: linear-gradient(135deg, #1dd1a1 0%, #48dbfb 100%);
    --gradient-candy: linear-gradient(135deg, #ff9ff3 0%, #feca57 100%);
    --gradient-rainbow: linear-gradient(90deg, #ff6b6b, #feca57, #1dd1a1, #48dbfb, #5f27cd, #ff9ff3);
    
    /* Sombras Suaves */
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 15px 50px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.4);
    
    /* Tipografia */
    --font-fun: 'Fredoka One', cursive;
    --font-body: 'Nunito', sans-serif;
    
    /* Bordas Arredondadas */
    --radius-small: 12px;
    --radius-medium: 20px;
    --radius-large: 30px;
    --radius-round: 50%;
    
    /* Espaçamentos */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;
}

/* Background Animado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(72, 219, 251, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(254, 202, 87, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 60% 60%, rgba(29, 209, 161, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Header Modernizado */
.auth-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-large);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.auth-header::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--radius-large) + 3px);
    background: var(--gradient-rainbow);
    z-index: -1;
    opacity: 0.5;
}

/* Título Principal - Design Moderno e Visível */
.main-title {
    font-family: var(--font-fun);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: white;
    text-align: center;
    flex: 1;
    padding: 15px 40px;
    background: linear-gradient(90deg, 
        #ff9a9e 0%, 
        #fecfef 15%, 
        #a8edea 30%, 
        #fed6e3 45%,
        #d299c2 60%,
        #a8c0ff 75%,
        #c2e9fb 90%,
        #ffecd2 100%
    );
    background-size: 200% 100%;
    animation: rainbowSlide 8s ease-in-out infinite;
    border-radius: 50px;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.main-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes rainbowSlide {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Botões de Autenticação */
.auth-buttons {
    display: flex;
    gap: var(--space-sm);
}

.auth-btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-medium);
    font-family: var(--font-fun);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.auth-btn.login-btn {
    background: var(--gradient-ocean);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.4);
}

.auth-btn.register-btn {
    background: var(--gradient-sunset);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.auth-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.auth-btn:active {
    transform: scale(0.95);
}

/* Display de Pontuação */
.score-display {
    background: var(--gradient-candy);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-fun);
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--shadow-soft);
    animation: pulse-glow 2s ease-in-out infinite;
}

.score-display .stars {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Nível Display */
.level-display {
    background: var(--gradient-forest);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-medium);
    font-family: var(--font-fun);
    font-size: 1rem;
    box-shadow: var(--shadow-soft);
}

/* Botão de Ranking */
.ranking-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-medium);
    font-family: var(--font-fun);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.ranking-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Grid de Módulos */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* Cards de Módulos - Design Divertido para Crianças */
.module-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-large);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-medium);
    border: 4px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

/* Cores diferentes para cada módulo */
.module-card[data-module="abc"] {
    border-color: var(--color-green);
    background: linear-gradient(135deg, rgba(29, 209, 161, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card[data-module="silabas"] {
    border-color: var(--color-blue);
    background: linear-gradient(135deg, rgba(72, 219, 251, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card[data-module="desenho"] {
    border-color: var(--color-pink);
    background: linear-gradient(135deg, rgba(255, 159, 243, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card[data-module="cores"] {
    border-color: var(--color-red);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card[data-module="animais"] {
    border-color: var(--color-orange);
    background: linear-gradient(135deg, rgba(254, 202, 87, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card[data-module="numeros"] {
    border-color: var(--color-purple);
    background: linear-gradient(135deg, rgba(95, 39, 205, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.module-card.gamification-card {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 255, 255, 0.95) 100%);
}

/* Hover nos Cards */
.module-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--shadow-strong), 0 0 30px rgba(102, 126, 234, 0.3);
    animation: wiggle 0.5s ease-in-out;
}

.module-card:hover .module-icon {
    animation: pop 0.5s ease-in-out;
}

.module-card:active {
    transform: scale(0.95);
}

/* Efeito de brilho no hover */
.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.module-card:hover::before {
    left: 100%;
}

/* Ícone do Módulo */
.module-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    animation: float-up-down 3s ease-in-out infinite;
    z-index: 2;
    position: relative;
}

.module-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

/* Títulos dos Cards */
.module-card h3 {
    font-family: var(--font-fun);
    font-size: 1.5rem;
    color: #2d3436;
    margin: 0;
    z-index: 2;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.module-card p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #636e72;
    margin: 0;
    font-weight: 700;
    z-index: 2;
    position: relative;
}

/* Gamification Stats no Card */
.gamification-stats {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    z-index: 2;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 215, 0, 0.2);
    padding: 5px 12px;
    border-radius: var(--radius-small);
    font-family: var(--font-fun);
}

.quick-stat .stat-icon {
    font-size: 1.2rem;
}

.quick-stat .stat-value {
    font-size: 1rem;
    color: var(--color-dark);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-round);
    border: 3px solid var(--color-primary);
    object-fit: cover;
}

.username {
    font-family: var(--font-fun);
    font-size: 1rem;
    color: var(--color-dark);
}

.logout-btn {
    background: var(--gradient-sunset);
    color: white;
    border: none;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-small);
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: scale(1.05);
}

/* Mascote Animado */
.mascot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    z-index: 1000;
    cursor: pointer;
    animation: float-up-down 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.mascot-container:hover {
    transform: scale(1.1);
}

.mascot-bubble {
    position: absolute;
    bottom: 110%;
    right: 0;
    background: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-medium);
    font-family: var(--font-body);
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.mascot-container:hover .mascot-bubble {
    opacity: 1;
    transform: translateY(0);
}

/* Confetes para Celebração */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 9999;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Media Queries - Responsivo para Tablets */
@media (max-width: 1024px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .auth-header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .module-card {
        padding: var(--space-md);
        min-height: 160px;
    }
    
    .module-icon {
        width: 60px;
        height: 60px;
    }
    
    .module-card h3 {
        font-size: 1.1rem;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modules-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
        padding: var(--space-xs);
    }
    
    .module-card {
        padding: var(--space-sm);
        min-height: 140px;
        border-radius: var(--radius-medium);
    }
    
    .module-icon {
        width: 50px;
        height: 50px;
    }
    
    .module-card h3 {
        font-size: 0.95rem;
    }
    
    .module-card p {
        font-size: 0.8rem;
    }
    
    .auth-header {
        padding: var(--space-sm);
        border-radius: var(--radius-medium);
    }
    
    .auth-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.85rem;
    }
}

/* Acessibilidade - Foco visível */
.module-card:focus,
.auth-btn:focus,
.ranking-btn:focus {
    outline: 4px solid var(--color-primary);
    outline-offset: 4px;
}

/* Modo de alto contraste para acessibilidade */
@media (prefers-contrast: high) {
    .module-card {
        border-width: 4px;
        border-color: var(--color-dark);
    }
    
    .module-card h3 {
        color: black;
    }
}

/* Redução de movimento para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
