/* ========================================
   Python Pro - Interactive Learning Platform
   Inspired by python2 folder design
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --secondary-color: #FF9800;
    --accent-color: #2196F3;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --text-dark: #333;
    --text-light: #fff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
}

/* Particles Background */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== WRAPPER & LAYOUT ===== */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== SIDEBAR ===== */
#sidebar-wrapper {
    width: 280px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-heading {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-heading .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-heading h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.snake-icon {
    font-size: 2.5rem;
    animation: wiggle 2s infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.list-group {
    padding: 1.5rem 1rem;
    flex: 1;
}

.list-group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 0.5rem;
    background: transparent;
    border: none;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.list-group-item i {
    font-size: 1.2rem;
}

/* User Profile in Sidebar */
.user-profile {
    padding: 1.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.user-profile .avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #333;
}

.user-profile .btn {
    background: linear-gradient(135deg, #f44336, #E91E63);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    font-weight: 700;
    transition: all 0.3s;
    color: white;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.user-profile .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.4);
    color: white;
}

/* ===== MAIN CONTENT ===== */
#page-content-wrapper {
    flex: 1;
    padding: 2rem 3rem;
    position: relative;
    z-index: 1;
}

/* ===== HEADER / WELCOME SECTION ===== */
.welcome-section {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.welcome-section h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.wave {
    display: inline-block;
    animation: wave 1.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-10deg); }
}

/* Mascot */
.mascot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.mascot {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.speech-bubble {
    background: white;
    color: #333;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    max-width: 300px;
    position: relative;
    box-shadow: var(--card-shadow);
    font-weight: 600;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    border: 10px solid transparent;
    border-right-color: white;
}

/* ===== STATS CARDS ===== */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-item.streak {
    background: linear-gradient(135deg, #FF6B6B, #f44336);
    color: white;
}

.stat-item.coins {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.stat-item.xp {
    background: linear-gradient(135deg, #9C27B0, #673AB7);
    color: white;
}

.stat-item i {
    font-size: 1.3rem;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* ===== LEVEL SECTIONS ===== */
.level-section {
    margin-bottom: 3rem;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--level-color, #4CAF50);
}

.level-emoji {
    font-size: 2.5rem;
}

.level-header h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    flex: 1;
}

.level-progress {
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 15px;
}

/* ===== TOPICS GRID ===== */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* ===== TOPIC CARDS ===== */
.topic-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.topic-card .card-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    border-radius: 25px 25px 0 0;
}

.topic-card .completed-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.topic-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.topic-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.topic-card.locked .lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-radius: 25px;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.topic-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.topic-card p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.5;
}

.card-difficulty {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.card-difficulty .star {
    color: #FFD700;
    font-size: 1rem;
}

.card-difficulty .star.empty {
    opacity: 0.3;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.card-xp {
    font-size: 0.9rem;
    color: #FFD700;
    font-weight: 700;
}

.start-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
    color: white;
}

.start-btn.locked {
    background: rgba(255,255,255,0.2);
    cursor: not-allowed;
}

/* ===== LEARNING MATERIALS CARDS ===== */
.learning-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.learning-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.learning-card .card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.learning-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.learning-card p {
    font-size: 0.95rem;
    opacity: 0.8;
}

.learning-card .view-btn {
    background: linear-gradient(135deg, var(--accent-color), #1976D2);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.learning-card .view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
}

/* ===== MODAL STYLING ===== */
.modal-content {
    background: var(--bg-gradient);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--accent-color), #1976D2);
    border: none;
    padding: 1.5rem 2rem;
}

.modal-header h5 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: white;
}

.modal-body {
    padding: 0;
}

.ppt-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    background: #000;
}

.ppt-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ppt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
}

.modal-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
}

/* ===== BADGES SECTION ===== */
.badges-section {
    padding: 2rem;
    background: var(--card-bg);
    margin: 2rem 0;
    border-radius: 25px;
}

.badges-section h3 {
    font-family: 'Fredoka One', cursive;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.badges-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.badge-item {
    width: 80px;
    height: 100px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #333;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.badge-item i {
    font-size: 1.8rem;
}

.badge-item.locked {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.badge-item.locked::after {
    content: '🔒';
    position: absolute;
    font-size: 1.2rem;
}

.badge-item:hover:not(.locked) {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-in {
    animation: staggerIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }
}

/* ===== FOOTER ===== */
.main-footer {
    text-align: center;
    padding: 2rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    #sidebar-wrapper {
        width: 80px;
    }
    
    .sidebar-heading h1,
    .list-group-item span,
    .user-profile .d-flex > div:last-child {
        display: none;
    }
    
    .list-group-item {
        justify-content: center;
        padding: 1rem;
    }
    
    .user-profile .avatar {
        margin: 0 auto 1rem;
    }
    
    #page-content-wrapper {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    #wrapper {
        flex-direction: column;
    }
    
    #sidebar-wrapper {
        width: 100%;
        height: auto;
        flex-direction: row;
        position: relative;
    }
    
    .sidebar-heading {
        padding: 1rem;
    }
    
    .list-group {
        display: flex;
        flex-direction: row;
        padding: 0.5rem;
        flex: 1;
    }
    
    .list-group-item {
        margin: 0;
        padding: 0.75rem;
    }
    
    .user-profile {
        display: none;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h2 {
        font-size: 1.8rem;
    }
    
    .stats-container {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== AUTHENTICATION PAGES ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

.auth-logo i {
    font-size: 2.5rem;
    color: white;
}

.auth-header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #a8edea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.auth-alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-alert.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ff6b6b;
}

.auth-alert.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #69f0ae;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.auth-form label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.auth-form input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.auth-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

.auth-btn:active {
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.7);
}

.auth-footer a {
    color: var(--secondary-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.auth-benefits {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.auth-benefits .benefit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-benefits .benefit i {
    color: var(--secondary-color);
}

.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.1;
}

.decoration-circle.circle-1 {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -100px;
}

.decoration-circle.circle-2 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: -75px;
}

.decoration-circle.circle-3 {
    width: 100px;
    height: 100px;
    bottom: 50%;
    right: -50px;
}

/* ===== MAIN HEADER (Dashboard) ===== */
.main-header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: white;
}

.main-header .logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.header-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-weight: 600;
}

.header-stats .stat-item.coins i { color: #ffd700; }
.header-stats .stat-item.xp i { color: #69f0ae; }
.header-stats .stat-item.level i { color: #ff9800; }
.header-stats .stat-item.streak i { color: #ff6b6b; }

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu .username {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu .logout-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-menu .logout-btn:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* ===== PROGRESS CONTAINER ===== */
.progress-container {
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.2);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* ===== NAVIGATION TABS ===== */
.nav-tabs {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 2rem;
}

.nav-tab {
    padding: 1rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== WELCOME SECTION ===== */
.welcome-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-text h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.welcome-text .highlight {
    color: var(--secondary-color);
}

.welcome-text p {
    color: rgba(255, 255, 255, 0.7);
}

.mascot {
    font-size: 4rem;
}

.mascot-icon {
    color: var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

/* ===== BADGES SECTION ===== */
.badges-section {
    margin-bottom: 2rem;
}

.badges-section h3 {
    font-family: 'Fredoka One', cursive;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badges-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.badge.earned {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 152, 0, 0.2));
    border-color: rgba(255, 215, 0, 0.5);
}

.badge.earned i:first-child {
    color: #ffd700;
}

.badge.locked {
    opacity: 0.5;
}

.badge .badge-lock {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.7rem;
}

/* ===== TOPICS SECTION ===== */
.topics-section {
    margin-top: 2rem;
}

.section-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.level-section {
    margin-bottom: 2rem;
}

.level-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.level-section.beginner .level-title {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
    border-left: 4px solid var(--primary-color);
}

.level-section.intermediate .level-title {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.3), rgba(255, 152, 0, 0.1));
    border-left: 4px solid var(--secondary-color);
}

.level-section.advanced .level-title {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.3), rgba(156, 39, 176, 0.1));
    border-left: 4px solid #9c27b0;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.topic-card.unlocked:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.3);
}

.topic-card.completed {
    border-color: rgba(76, 175, 80, 0.5);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.05));
}

.topic-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.card-ribbon {
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topic-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.topic-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.topic-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

.difficulty i.filled {
    color: #ffd700;
}

.xp-badge {
    background: rgba(255, 152, 0, 0.2);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 16px;
}

.lock-overlay i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.lock-overlay span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== LEARNING SECTION ===== */
.learning-section {
    margin-top: 1rem;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.material-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.material-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-color, var(--primary-color));
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.material-icon {
    width: 60px;
    height: 60px;
    background: var(--card-color, var(--primary-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.material-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.material-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.material-actions {
    margin-top: 1rem;
}

.view-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: var(--card-color, var(--primary-color));
    color: white;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.material-number {
    position: absolute;
    top: 10px;
    right: 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.1);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-family: 'Fredoka One', cursive;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error-color);
}

.modal-body {
    padding: 0;
}

.presentation-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.presentation-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.download-block {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 60px;
    background: rgba(30, 30, 50, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-block .block-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* ===== SOUND TOGGLE ===== */
.sound-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.sound-toggle.muted {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== PARTICLES ===== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s infinite ease-in-out;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== RESPONSIVE (Auth) ===== */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-benefits {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .header-stats .stat-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .nav-tabs {
        padding: 0 1rem;
    }
    
    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .welcome-text h1 {
        font-size: 1.4rem;
    }
    
    .mascot {
        font-size: 3rem;
    }
    
    .badges-container {
        justify-content: center;
    }
    
    .badge {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .topics-grid,
    .materials-grid {
        grid-template-columns: 1fr;
    }
}
