/* Custom CSS Design System - Ulearn Hub */
:root {
    /* Color Palette - Light Mode Default */
    --primary-color: #1a365d;
    --primary-light: #2a4365;
    --accent-color: #ff6b35;
    --accent-hover: #e0531f;
    --bg-color: #f7fafc;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-color: #2d3748;
    --text-muted: #718096;
    --shadow-color: rgba(26, 54, 93, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --success-color: #48bb78;
    --glass-blur: blur(16px);
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #90cdf4;
    --primary-light: #63b3ed;
    --accent-color: #fbd38d;
    --accent-hover: #f6ad55;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(15, 23, 42, 0.85);
    --success-color: #38a169;
}

/* Global resets & typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Be Vietnam Pro', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.03);
}

.logo-icon {
    font-size: 28px;
    margin-right: 8px;
    color: var(--accent-color);
}

.accent-text {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link.active::after, .nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn, .mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 107, 53, 0.15);
    color: var(--accent-color);
    transform: rotate(15deg);
}

.mobile-menu-btn {
    display: none;
}

/* Sections & Tabs content management */
.main-content {
    margin-top: 72px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    padding: 48px 0;
    flex-grow: 1;
}

.tab-content.active-section {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 107, 53, 0.08);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
}

body.dark-mode .btn-secondary {
    color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-large {
    padding: 16px 36px;
    font-size: 18px;
    border-radius: 12px;
}

/* Glass Card styling */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.3s ease;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.section-header p {
    color: var(--text-muted);
    font-size: 16px;
}

body.dark-mode .section-header h2 {
    color: var(--primary-color);
}

/* --- SECTION 1: HOME --- */
.hero-wrapper {
    background: radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.1) 0%, transparent 60%);
    padding: 60px 0;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-text {
    flex: 1;
    max-width: 580px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 107, 53, 0.15);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 24px;
}

.hero-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 500px;
}

.blob-bg {
    position: absolute;
    width: 380px;
    height: 380px;
    background: linear-gradient(185deg, rgba(26, 54, 93, 0.1) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 1;
}

.student-illustration {
    position: relative;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.avatar-circle {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 20px 40px var(--shadow-color);
}

.student-avatar-img {
    width: 85%;
    height: 85%;
    object-fit: cover;
    border-radius: 50%;
}

.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.f-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--shadow-color);
    font-size: 20px;
    color: var(--accent-color);
}

.fi-1 { top: -10px; left: 30px; animation: orbit1 8s linear infinite; }
.fi-2 { top: 40px; right: -20px; animation: orbit2 9s linear infinite; }
.fi-3 { bottom: -10px; left: 60px; animation: orbit3 10s linear infinite; }
.fi-4 { bottom: 50px; left: -20px; animation: orbit4 7s linear infinite; }

/* Video Introduction Section */
.video-section {
    padding: 60px 0;
}

.video-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--card-border);
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    background-color: #0b0f19;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.3s ease;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
    transition: all 0.2s ease;
}

.play-btn:hover {
    transform: scale(1.1);
    background-color: var(--accent-hover);
}

.video-duration {
    font-size: 14px;
    opacity: 0.8;
}

.simulated-video {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 40px;
    text-align: center;
}

.video-scene {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.video-scene.active-scene {
    display: flex;
    animation: fadeIn 0.4s ease-in-out;
}

.scene-icon {
    font-size: 64px;
}

.video-controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-progress {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.video-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color);
}

.video-time {
    font-size: 13px;
}

/* Counter */
.counter-section {
    padding: 30px 0;
}

.counter-card {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.counter-number {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--accent-color);
    margin: 0 8px;
    display: inline-block;
}

.counter-label {
    color: var(--text-color);
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Roadmap Grid */
.roadmap-section {
    padding: 60px 0;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.roadmap-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    padding: 32px 24px;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 8px 32px var(--shadow-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.roadmap-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
}

.roadmap-card:hover .step-num {
    color: rgba(255, 107, 53, 0.85);
}

.step-num {
    position: absolute;
    right: 16px;
    top: 10px;
    font-size: 48px;
    font-weight: 800;
    color: rgba(255, 107, 53, 0.6);
    line-height: 1;
    transition: color 0.3s ease;
}

.step-icon {
    font-size: 32px;
    margin-bottom: 20px;
}

.roadmap-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.roadmap-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.step-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- SECTION 2: PRONUNCIATION --- */
.ipa-tabs-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.ipa-tab-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ipa-tab-btn:hover, .ipa-tab-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.ipa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.ipa-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.ipa-card:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.ipa-char {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent-color);
}

.ipa-example {
    font-size: 13px;
    color: var(--text-muted);
}

.ipa-sound-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    transition: color 0.2s ease;
    padding: 4px;
}

.ipa-sound-btn:hover {
    color: var(--accent-color);
}

/* --- SECTION 3: VOCABULARY --- */
.vocab-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.vocab-course-card {
    overflow: hidden;
}

.course-banner {
    height: 160px;
    background-color: var(--primary-color);
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.course-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-banner-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 48px;
    font-weight: 700;
}

.course-body {
    padding: 24px;
}

.course-body h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.course-body p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-price {
    font-weight: 700;
    font-size: 18px;
    color: var(--success-color);
}

.flashcard-practice-area {
    margin-top: 32px;
    animation: fadeIn 0.4s ease-in-out;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text:hover {
    color: var(--accent-color);
}

.flashcard-container {
    width: 100%;
    max-width: 480px;
    height: 340px;
    perspective: 1000px;
    margin: 0 auto 32px auto;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.flashcard-front {
    z-index: 2;
}

.flashcard-back {
    transform: rotateY(180deg);
    justify-content: center;
    gap: 16px;
}

.card-img-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    overflow: hidden;
}

.flashcard-img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
}

.flashcard-no-img {
    text-align: center;
    color: var(--text-muted);
}

.flashcard-word-preview {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.card-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.card-phonetic {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: var(--accent-color);
}

.audio-btn-small {
    background-color: rgba(255, 107, 53, 0.1);
    border: none;
    color: var(--accent-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.audio-btn-small:hover {
    background-color: var(--accent-color);
    color: white;
}

.card-meaning {
    font-size: 24px;
    font-weight: 700;
}

.card-example {
    font-size: 15px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

/* --- SECTION 4: COMMUNICATION --- */
.comm-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.comm-sidebar {
    padding: 24px;
}

.comm-sidebar h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-item {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

body.dark-mode .topic-item {
    background-color: rgba(255, 255, 255, 0.03);
}

.topic-item:hover, .topic-item.active {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.comm-main {
    padding: 32px;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.comm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rate-label {
    font-size: 13px;
    color: var(--text-muted);
}

.rate-btn {
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.rate-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.chat-screen {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideInUp 0.3s ease-out;
}

.chat-bubble.left {
    align-self: flex-start;
}

.chat-bubble.right {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 107, 53, 0.12);
}

.bubble-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bubble-avatar-initials {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-color);
}

.bubble-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bubble-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.bubble-text {
    padding: 12px 16px;
    border-radius: 16px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    position: relative;
}

.chat-bubble.left .bubble-text {
    border-top-left-radius: 4px;
}

.chat-bubble.right .bubble-text {
    border-top-right-radius: 4px;
    background-color: rgba(255, 107, 53, 0.15);
}

.bubble-sound-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
    color: var(--text-muted);
}

.bubble-sound-btn:hover {
    color: var(--accent-color);
}

.bubble-translation {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

/* --- SECTION 5: PRACTICE --- */
.quiz-container-wrapper {
    max-width: 680px;
    margin: 0 auto 48px auto;
}

.quiz-card {
    padding: 40px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 107, 53, 0.1);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    width: fit-content;
    margin: 0 auto 24px auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 16px;
}

.quiz-progress-wrapper {
    flex-grow: 1;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-progress-bar-bg {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

body.dark-mode .quiz-progress-bar-bg {
    background-color: rgba(255, 255, 255, 0.1);
}

.quiz-progress-bar-fill {
    height: 100%;
    width: 10%;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.badge {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
}

.question-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 24px;
}

.question-media {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 72px;
}

.media-audio-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.media-audio-btn:hover {
    transform: scale(1.08);
}

.media-img {
    max-height: 150px;
    object-fit: contain;
}

#question-text {
    font-size: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-btn {
    padding: 16px;
    text-align: left;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.option-btn:hover {
    border-color: var(--accent-color);
    background-color: rgba(255, 107, 53, 0.05);
}

.option-btn.correct {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.option-btn.incorrect {
    background-color: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

.option-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.question-type-label {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
}

.result-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
    animation: pop 0.5s ease-out;
}

.result-icon-wrapper.result-excellent {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.result-icon-wrapper.result-pass {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.result-icon-wrapper.result-retry {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}

@keyframes pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-message {
    color: var(--text-muted);
    margin: 16px 0 32px 0;
}

.result-btns {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Feedback Form styling */
.feedback-section {
    max-width: 680px;
    margin: 0 auto;
    padding: 32px;
}

.feedback-section h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.feedback-section p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
}

.form-group input, .form-group textarea {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #f6e05e;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(72, 187, 120, 0.15);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* --- FLOATING AI CHATBOX WIDGET --- */
.ai-chatbox-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbox-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    transition: all 0.2s ease;
}

.chatbox-toggle:hover {
    transform: scale(1.08);
}

.chatbox-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e53e3e;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
}

.chatbox-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbox-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chatbox-header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbox-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbox-avatar {
    font-size: 28px;
}

.chatbox-header-info h4 {
    font-size: 15px;
    font-weight: 600;
}

.status-indicator {
    font-size: 11px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.chatbox-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

.chatbox-close-btn:hover {
    opacity: 1;
}

.chatbox-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

.chat-msg.system {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.chat-msg.user {
    background-color: var(--accent-color);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.chat-msg.suggestions {
    background: none;
    border: none;
    padding: 0;
    max-width: 100%;
}

.chat-msg.suggestions p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.suggest-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 107, 53, 0.08);
    border: 1px dashed var(--accent-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.suggest-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.chatbox-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--card-border);
    gap: 8px;
}

#chatbox-input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
}

#chatbox-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.chatbox-send-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chatbox-send-btn:hover {
    background-color: var(--accent-hover);
}

/* Fireworks Overlay Canvas */
.fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Modal guide styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 32px;
    position: relative;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
}

#modal-ipa-char {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 4px;
}

#modal-ipa-name {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.mouth-guide-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.mouth-illustration {
    font-size: 64px;
}

.mouth-text-instructions h4 {
    font-size: 15px;
    margin-bottom: 8px;
}

.mouth-text-instructions p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.modal-example-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
}

.example-sound-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(255, 107, 53, 0.08);
}

.example-word {
    font-weight: 700;
    font-size: 18px;
}

.example-ipa {
    color: var(--accent-color);
}

/* Footer styling */
.footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.7);
    padding: 32px 0;
    margin-top: auto;
    border-top: 1px solid var(--card-border);
}

body.dark-mode .footer {
    background-color: #0b0f19;
}

.footer p {
    font-size: 14px;
}

.footer-sub {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.6;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive styles */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-btns {
        justify-content: center;
    }
    .comm-layout {
        grid-template-columns: 1fr;
    }
    .options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header .nav-container {
        position: relative;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        box-shadow: 0 10px 20px var(--shadow-color);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--card-border);
    }
    .nav-menu.mobile-open {
        display: flex;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .ai-chatbox-widget {
        bottom: 20px;
        right: 20px;
    }
    .chatbox-panel {
        width: 320px;
        bottom: 70px;
    }
}

/* Float orbiting animations for Hero icons */
@keyframes orbit1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10px, -15px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}
@keyframes orbit2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, 10px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}
@keyframes orbit3 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(12px, 12px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}
@keyframes orbit4 {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-10px, -10px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}