@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Premium Dark Theme RPG Palette */
    --bg-base: #060b18; /* Deeper space blue */
    --bg-surface: #0f1a2e; /* Slightly lighter for contrast */
    --bg-card: rgba(15, 26, 46, 0.7);
    --primary: #4f46e5; /* Indigo */
    --primary-glow: rgba(79, 70, 229, 0.6);
    --accent: #10b981; /* Emerald / Success / XP */
    --accent-glow: rgba(16, 185, 129, 0.6);
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
}

@keyframes bg-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99,102,241,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.10) 0%, transparent 60%),
        linear-gradient(135deg, rgba(6, 11, 24, 0.95), rgba(15, 26, 46, 0.95));
    background-size: 200% 200%;
    animation: bg-pan 20s infinite ease-in-out;
    background-attachment: fixed;
    padding-bottom: 50px;
}

.text-muted, a.text-muted, a.text-muted:hover, a.text-muted:focus {
    color: #cbd5e1 !important; /* Slightly brighter for better contrast */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Glassmorphism Header */
.header-premium {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Premium Cards */
.card-premium {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-premium:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.5), 0 0 25px var(--primary-glow);
}

/* Duolingo / RPG Buttons */
.btn-premium {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 16px;
    padding: 12px 24px;
    border: none;
    position: relative;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-primary-rpg {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 6px 0 #2563eb, 0 15px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary-rpg:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #2563eb, 0 5px 10px rgba(59, 130, 246, 0.4);
}

.btn-success-rpg {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 6px 0 #059669, 0 15px 20px rgba(16, 185, 129, 0.4);
}

.btn-success-rpg:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #059669, 0 5px 10px rgba(16, 185, 129, 0.4);
}

.btn-danger-rpg {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 6px 0 #dc2626, 0 15px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger-rpg:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #dc2626, 0 5px 10px rgba(239, 68, 68, 0.4);
}

.btn-outline-rpg {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 0 rgba(59, 130, 246, 0.5);
}

.btn-outline-rpg:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.btn-outline-rpg:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 rgba(59, 130, 246, 0.5);
}

/* Forms */
.form-control-premium {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 2px solid var(--border-color) !important;
    color: white !important;
    border-radius: 16px;
    padding: 14px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-control-premium:focus {
    background-color: rgba(15, 23, 42, 0.9) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
    outline: none;
}

.form-control-premium::placeholder {
    color: var(--text-muted);
}

/* XP Badge */
.badge-xp {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Modals */
.modal-content-premium {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Premium Tabs (War Table Style) */
.nav-pills .nav-link {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-pills .nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.8), rgba(99, 102, 241, 0.8)) !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Sidebar Styles */
.sidebar-premium {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-link-premium {
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-link-premium:hover, .nav-link-premium.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link-premium.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent);
    border-left: 4px solid var(--primary);
}

/* Auth Split Screen */
.auth-split {
    min-height: 100vh;
    display: flex;
}

.auth-brand-side {
    flex: 1;
    background: linear-gradient(135deg, var(--bg-base) 0%, rgba(59, 130, 246, 0.2) 100%), url('https://images.unsplash.com/photo-1542751371-adc38448a05e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-brand-side::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    padding: 2rem;
}

@media (max-width: 991px) {
    .auth-brand-side {
        display: none;
    }
}

/* Misc Utilities */
.hover-white:hover {
    color: white !important;
}
.transition-all {
    transition: all 0.3s ease;
}

/* Nav Pills Premium */
.nav-pills .nav-link {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.nav-pills .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.nav-pills .nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    color: #fff !important;
    border-color: rgba(59, 130, 246, 0.5);
}

/* Horizontal Scroll for Pills on Mobile */
.nav-pills-scrollable {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    gap: 0.5rem;
}
.nav-pills-scrollable::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
.nav-pills-scrollable .nav-item {
    flex-shrink: 0;
}

/* Premium FX */
.rank-1-glow {
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.4), 0 0 10px rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.8) !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), transparent) !important;
}

.rank-2-glow {
    box-shadow: inset 0 0 15px rgba(192, 192, 192, 0.4), 0 0 10px rgba(192, 192, 192, 0.2);
    border: 2px solid rgba(192, 192, 192, 0.8) !important;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), transparent) !important;
}

.rank-3-glow {
    box-shadow: inset 0 0 15px rgba(205, 127, 50, 0.4), 0 0 10px rgba(205, 127, 50, 0.2);
    border: 2px solid rgba(205, 127, 50, 0.8) !important;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), transparent) !important;
}

.badge-secret {
    filter: grayscale(100%) brightness(50%) blur(1px);
    opacity: 0.7;
}

.mascot-bounce {
    animation: bounceMascot 2s infinite ease-in-out;
}

@keyframes bounceMascot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================================================
   AVATAR FRAMES (MOLDURAS LENDÁRIAS ANIMADAS)
   ========================================================================== */
.avatar-frame-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-frame-gold {
    position: relative;
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ffee55, #ffd700);
    background-size: 300% 300%;
    animation: frameRotate 4s linear infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.4);
}

.avatar-frame-silver {
    position: relative;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2e8f0, #94a3b8, #f8fafc, #cbd5e1);
    background-size: 300% 300%;
    animation: frameRotate 5s linear infinite;
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.5);
}

.avatar-frame-bronze {
    position: relative;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d97706, #78350f, #f59e0b);
    background-size: 300% 300%;
    animation: frameRotate 6s linear infinite;
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.4);
}

.avatar-frame-cyber {
    position: relative;
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6, #3b82f6, #ec4899);
    background-size: 300% 300%;
    animation: frameRotate 3s linear infinite;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
}

@keyframes frameRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   HOLOGRAPHIC FOIL & IRIDESCENCE (CARDS LENDÁRIOS / LOJA)
   ========================================================================== */
.card-foil {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.8), rgba(49, 46, 129, 0.8));
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
}

.card-foil::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 40%,
        rgba(255, 215, 0, 0.2) 45%,
        rgba(236, 72, 153, 0.2) 50%,
        rgba(6, 182, 212, 0.2) 55%,
        transparent 65%
    );
    transform: rotate(25deg);
    transition: transform 0.6s ease;
    pointer-events: none;
    opacity: 0;
}

.card-foil:hover::after {
    opacity: 1;
    transform: rotate(25deg) translateY(100%);
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

/* ==========================================================================
   CINEMATOGRAPHIC CELEBRATION MODAL & RAYBURST
   ========================================================================== */
.tp-celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 11, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.tp-celebration-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tp-celebration-card {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 2px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(250, 204, 21, 0.3);
    border-radius: 28px;
    padding: 40px 30px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.tp-celebration-overlay.active .tp-celebration-card {
    transform: scale(1) translateY(0);
}

.tp-rayburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(250, 204, 21, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: raySpin 20s linear infinite;
    z-index: 0;
}

@keyframes raySpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.tp-celebration-content {
    position: relative;
    z-index: 1;
}

.tp-count-up-val {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* ==========================================================================
   DAILY CHEST MODAL (BAÚ DIÁRIO INTERATIVO)
   ========================================================================== */
.tp-chest-box {
    font-size: 5.5rem;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 15px 25px rgba(245, 158, 11, 0.5));
}

.tp-chest-box:hover {
    transform: scale(1.15) rotate(4deg);
}

.tp-chest-shake {
    animation: chestShake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both infinite;
}

@keyframes chestShake {
    10%, 90% { transform: translate3d(-2px, 0, 0) rotate(-4deg); }
    20%, 80% { transform: translate3d(3px, 0, 0) rotate(4deg); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0) rotate(-6deg); }
    40%, 60% { transform: translate3d(5px, 0, 0) rotate(6deg); }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR (NATIVE APP FEEL)
   ========================================================================== */
.tp-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1050;
    padding: 0 10px;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

.tp-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 12px;
    position: relative;
    flex: 1;
    max-width: 80px;
}

.tp-bottom-nav-item span {
    white-space: nowrap !important;
    line-height: 1 !important;
    letter-spacing: -0.1px;
}

.tp-bottom-nav-item i, .tp-bottom-nav-item span.emoji-icon {
    font-size: 1.25rem;
    margin-bottom: 3px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.tp-bottom-nav-item:hover, .tp-bottom-nav-item.active {
    color: #ffffff;
}

.tp-bottom-nav-item.active {
    color: #38bdf8 !important;
}

.tp-bottom-nav-item.active i {
    transform: translateY(-2px);
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.tp-bottom-nav-item .badge-dot {
    position: absolute;
    top: 6px;
    right: 18px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
}

/* ==========================================================================
   SKELETON SHIMMER LOADERS
   ========================================================================== */
.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-box {
    height: 60px;
    width: 100%;
    margin-bottom: 12px;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-text {
    height: 16px;
    width: 70%;
    margin-bottom: 8px;
}

/* ==========================================================================
   LIVE TOAST DISPATCHER
   ========================================================================== */
.tp-live-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1070;
    max-width: 350px;
    pointer-events: none;
}

.tp-live-toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(250, 204, 21, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(250, 204, 21, 0.2);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 10px;
    color: #ffffff;
    backdrop-filter: blur(12px);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ==========================================================================
   AUDIO TOGGLE PILL
   ========================================================================== */
.tp-audio-pill {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tp-audio-pill:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
}

/* ==========================================================================
   PRINT STYLES FOR TEACHER REPORT
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        background-image: none !important;
    }
    .sidebar-premium, .mobile-navbar-premium, .tp-bottom-nav, #notificationModal, .btn, .nav-pills, .badge-streak, .badge-coins {
        display: none !important;
    }
    .card-premium {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .text-white, .text-white-50, .text-muted {
        color: #000000 !important;
    }
    .table {
        color: #000000 !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    body {
        animation: none !important;
    }
}


