/* ============================================
   COWDI ENGLISH - Core Styles
   ============================================ */

:root {
    /* Primary Colors - Cowdi Theme */
    --primary: #FF6B9D;
    --primary-light: #FF8FB8;
    --primary-dark: #E0527E;
    --secondary: #4ECDC4;
    --secondary-light: #7EDDD6;
    --secondary-dark: #3BA89F;
    
    /* Accent Colors */
    --accent-yellow: #FFE66D;
    --accent-orange: #FF9F43;
    --accent-purple: #A29BFE;
    --accent-blue: #74B9FF;
    
    /* Neutral Colors */
    --bg: #FFF8F0;
    --bg-card: #FFFFFF;
    --bg-dark: #2D3436;
    --text: #2D3436;
    --text-light: #636E72;
    --text-muted: #B2BEC3;
    --border: #E8E8E8;
    
    /* Status Colors */
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #FF7675;
    --info: #74B9FF;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
    
    /* Typography */
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1 { font-size: 2.2rem; font-weight: 800; }
h2 { font-size: 1.8rem; font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { color: var(--text-light); }

.highlight { 
    color: var(--primary); 
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: var(--text);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    text-decoration: none;
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-full);
}

.nav-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--primary-light);
    color: white;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-user {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.streak-badge, .xp-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.85rem;
}

.streak-badge {
    background: linear-gradient(135deg, #FF9F43, #FF6B6B);
    color: white;
}

.xp-badge {
    background: linear-gradient(135deg, #A29BFE, #6C5CE7);
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

.page {
    display: none;
    padding: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }

.btn-lg { padding: 0.8rem 1.8rem; font-size: 1.1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--accent-orange); }

.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-xl);
    transition: width 0.5s ease;
}

/* Inputs */
.search-input, .select-input {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
}

.search-input:focus, .select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
.bounce {
    animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.pop {
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================
   MASCOT SIZES
   ============================================ */
.mascot-img { max-width: 300px; height: auto; }
.mascot-md { width: 120px; height: auto; }
.mascot-sm { width: 80px; height: auto; }
.mascot-xs { width: 50px; height: auto; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    min-width: 250px;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============================================
   COWDI CHAT BUBBLE
   ============================================ */
.cowdi-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary);
    background: var(--bg-card);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-avatar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.chat-bubble {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-card);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary-light);
    max-width: 280px;
    min-width: 220px;
    animation: pop 0.3s ease;
}

.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bg-card);
}

.chat-bubble p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 var(--space-md);
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 2px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.show { display: flex; }
    
    .nav-toggle { display: block; }
    
    .nav-user { display: none; }
    
    .page { padding: var(--space-md); }
    
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .mascot-img { max-width: 200px; }
    
    .features-grid,
    .stats-grid,
    .practice-types,
    .progress-grid,
    .lessons-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
}
