/* =========================================
   QueenieLang - Language Learning & Productivity Tools
   Modern, Clean, Professional with Warm Academic Feel
   ========================================= */

/* CSS Variables */
:root {
    --primary: #0d7377;
    --primary-dark: #095557;
    --primary-light: #14919b;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fbbf24;
    --cream: #fef9e7;
    --cream-dark: #fdf6dc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6; color: var(--text-primary); background-color: var(--cream); min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

/* Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* =========================================
   Header & Navigation
   ========================================= */
.header {
    background: var(--white); box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 1000;
}
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 0;
}
.logo {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.5rem; font-weight: 700; color: var(--primary);
}
.logo i { font-size: 1.75rem; }
.nav-menu { display: flex; gap: 2rem; align-items: center; }
.nav-menu a {
    font-weight: 500; color: var(--text-secondary);
    padding: 0.5rem 0; position: relative;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--primary); }
.nav-menu a.active::after {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 2px; background: var(--primary); border-radius: 2px;
}
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-primary); cursor: pointer; }

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
    border-radius: var(--radius-lg); border: none; cursor: pointer;
    transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-2px); }
.btn-secondary { background: var(--accent); color: var(--white); }
.btn-secondary:hover { background: var(--accent-dark); color: var(--white); }
.btn-outline {
    background: transparent; border: 2px solid var(--primary); color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

/* =========================================
   Hero Section
   ========================================= */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white); padding: 4rem 0; text-align: center;
}
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { color: var(--white); font-size: 3rem; margin-bottom: 1.5rem; }
.hero p { color: rgba(255, 255, 255, 0.9); font-size: 1.25rem; margin-bottom: 2rem; }
.hero-badges { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.badge {
    background: rgba(255, 255, 255, 0.2); padding: 0.5rem 1rem;
    border-radius: var(--radius-xl); font-size: 0.875rem;
    display: flex; align-items: center; gap: 0.5rem;
}

/* =========================================
   Sections
   ========================================= */
.section { padding: 4rem 0; }
.section-light { background: var(--white); }
.section-cream { background: var(--cream); }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 3rem; }
.section-header h2 { margin-bottom: 1rem; }
.section-header p { font-size: 1.125rem; }

/* =========================================
   Cards
   ========================================= */
.card {
    background: var(--white); border-radius: var(--radius-xl); padding: 1.5rem;
    box-shadow: var(--shadow); transition: var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg); display: flex; align-items: center;
    justify-content: center; margin-bottom: 1rem;
}
.card-icon i { font-size: 1.5rem; color: var(--white); }
.card-icon.accent { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); }
.card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.card p { font-size: 0.95rem; margin-bottom: 1rem; }
.card-link { font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }
.card-link i { transition: var(--transition); }
.card-link:hover i { transform: translateX(4px); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.tool-card { display: flex; flex-direction: column; height: 100%; }
.tool-card .card-body { flex: 1; display: flex; flex-direction: column; }
.tool-card .card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--gray-200); }

/* =========================================
   Article Cards
   ========================================= */
.article-card { overflow: hidden; }
.article-card .card-image { height: 200px; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 1rem; }
.article-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.article-card:hover .card-image img { transform: scale(1.05); }
.article-meta { display: flex; gap: 1rem; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.article-meta span { display: flex; align-items: center; gap: 0.25rem; }

/* =========================================
   Stats
   ========================================= */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat-item { text-align: center; padding: 1.5rem; }
.stat-number { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; }
.stat-label { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================
   Features
   ========================================= */
.features-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.feature-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-lg); }
.feature-item i { color: var(--primary); font-size: 1.25rem; margin-top: 0.125rem; }
.feature-item h4 { margin-bottom: 0.25rem; font-size: 1rem; }
.feature-item p { margin-bottom: 0; font-size: 0.875rem; }

/* =========================================
   Footer
   ========================================= */
.footer { background: var(--gray-900); color: var(--gray-300); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 3rem; margin-bottom: 3rem; }
.footer-brand { max-width: 300px; }
.footer-brand .logo { color: var(--white); margin-bottom: 1rem; }
.footer-brand p { color: var(--gray-400); font-size: 0.95rem; }
.footer-links h4 { color: var(--white); font-size: 1rem; margin-bottom: 1.25rem; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--gray-400); font-size: 0.95rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 2rem; border-top: 1px solid var(--gray-700);
}
.footer-bottom p { font-size: 0.875rem; margin-bottom: 0;; color: var(--gray-400); }
.social-links { display: flex; gap: 1rem; }
.social-links a { color: var(--gray-400); font-size: 1.25rem; transition: var(--transition); }
.social-links a:hover { color: var(--accent); }

/* =========================================
   Forms
   ========================================= */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.form-control {
    width: 100%; padding: 0.75rem 1rem; font-size: 1rem;
    border: 1px solid var(--gray-300); border-radius: var(--radius-lg);
    transition: var(--transition); background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1); }
textarea.form-control { min-height: 150px; resize: vertical; }
select.form-control { cursor: pointer; }

/* =========================================
   Tool Pages
   ========================================= */
.tool-container { max-width: 900px; margin: 0 auto; }
.tool-header { text-align: center; margin-bottom: 2rem; }
.tool-header h1 { font-size: 2.25rem; margin-bottom: 0.75rem; }
.tool-header p { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 0; }
.tool-box {
    background: var(--white); border-radius: var(--radius-xl); padding: 2rem;
    box-shadow: var(--shadow); margin-bottom: 2rem;
}
.tool-input { width: 100%; padding: 1rem; font-size: 1rem; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); min-height: 150px; resize: vertical; font-family: inherit; }
.tool-input:focus { outline: none; border-color: var(--primary); }
.tool-output { background: var(--cream); border-radius: var(--radius-lg); padding: 1.5rem; min-height: 100px; }
.tool-btn { background: var(--primary); color: var(--white); border: none; padding: 0.75rem 1.5rem; border-radius: var(--radius-lg); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.tool-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }
.tool-result { margin-top: 1.5rem; }
.result-item { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-200); }
.result-item:last-child { border-bottom: none; }
.result-label { font-weight: 600; color: var(--text-secondary); }
.result-value { color: var(--primary); font-weight: 700; font-size: 1.25rem; }

/* =========================================
   Media Queries
   ========================================= */
@media (max-width: 1024px) {
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-brand { grid-column: span 2; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; }
    .nav-menu {
        display: none !important; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--white); flex-direction: column; padding: 0;
        box-shadow: var(--shadow-lg); z-index: 1000; margin-top: 0.5rem;
    }
    .nav-menu.active { display: flex !important; }
    .nav-menu li { width: 100%; margin: 0; }
    .nav-menu a { display: block; padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-100); color: var(--text-primary); font-weight: 500; }
    .nav-menu a:hover { background: var(--gray-50); color: var(--primary); }
    .navbar { position: relative; }
    
    .hero { padding: 2.5rem 0; }
    .hero h1 { font-size: 2rem !important; line-height: 1.2; }
    .hero p { font-size: 1rem !important; }
    .hero-badges { flex-direction: column; align-items: center; gap: 0.5rem; }
    
    .section { padding: 2.5rem 0; }
    .section-header h2 { font-size: 1.5rem !important; }
    .section-header p { font-size: 1rem !important; }
    
    .card-grid-3, .card-grid-4 { grid-template-columns: 1fr !important; }
    .card { padding: 1.25rem; }
    .card-icon { width: 50px !important; height: 50px !important; }
    .card-icon i { font-size: 1.25rem !important; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .stat-number { font-size: 2rem !important; }
    
    .footer-grid { grid-template-columns: 1fr !important; }
    .footer-brand { grid-column: auto; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    
    .section-cream .btn { display: block; width: 100%; margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    .hero h1 { font-size: 1.625rem !important; }
    .hero p { font-size: 0.9375rem !important; }
    .badge { font-size: 0.8125rem; padding: 0.375rem 0.75rem; }
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
    .section-header h2 { font-size: 1.375rem !important; }
    .article-card .card-image { height: 160px; }
    .article-card .card-image img { height: 160px; }
    .article-meta { font-size: 0.8rem; }
    .article-card h3 { font-size: 1rem !important; }
}

/* Prevent horizontal scroll */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* =========================================
   Page Header
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white); padding: 3rem 0; text-align: center;
}
.page-header h1 { color: var(--white); font-size: 2.5rem; margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.9); font-size: 1.125rem; margin-bottom: 0; }

/* =========================================
   Tool Specific
   ========================================= */
.tool-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl); display: flex; align-items: center;
    justify-content: center; margin: 0 auto 1.5rem;
}
.tool-icon i { font-size: 2.5rem; color: var(--white); }
.tool-icon.accent { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); }

.tool-input-area { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.form-textarea { min-height: 150px; resize: vertical; }
.form-select { cursor: pointer; }

.tool-controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-controls .btn { flex: 1; min-width: 120px; }

.tool-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.slider-group { margin-bottom: 1rem; }
.slider-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.slider-value { float: right; font-weight: 600; color: var(--primary); }

.range-slider {
    width: 100%; height: 8px; border-radius: 4px;
    background: var(--gray-200); outline: none; -webkit-appearance: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: var(--primary); cursor: pointer;
}

.tool-result-box {
    background: var(--cream); border-radius: var(--radius-lg);
    padding: 1.5rem; margin-top: 1.5rem;
}
.result-highlight {
    background: var(--primary); color: var(--white);
    padding: 0.5rem 1rem; border-radius: var(--radius);
    display: inline-block; margin-bottom: 1rem;
}

/* Tool Navigation */
.tool-nav { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tool-nav a {
    padding: 0.5rem 1rem; background: var(--gray-100); border-radius: var(--radius);
    font-size: 0.875rem; color: var(--text-secondary);
}
.tool-nav a:hover { background: var(--primary); color: var(--white); }

/* =========================================
   Quiz Styles
   ========================================= */
.quiz-question {
    background: var(--white); border-radius: var(--radius-xl); padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.quiz-question h4 { margin-bottom: 1rem; font-size: 1.125rem; }
.quiz-options { display: grid; gap: 0.75rem; }
.quiz-option {
    padding: 1rem; background: var(--gray-50); border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg); cursor: pointer; transition: var(--transition);
}
.quiz-option:hover { border-color: var(--primary); background: var(--white); }
.quiz-option.correct { border-color: #22c55e; background: #dcfce7; }
.quiz-option.incorrect { border-color: #ef4444; background: #fee2e2; }
.quiz-progress {
    height: 8px; background: var(--gray-200); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 1.5rem;
}
.quiz-progress-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }

/* =========================================
   Flashcard Styles
   ========================================= */
.flashcard-container { perspective: 1000px; margin: 2rem 0; }
.flashcard {
    width: 100%; max-width: 500px; height: 300px; margin: 0 auto;
    position: relative; transform-style: preserve-3d;
    transition: transform 0.6s; cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; display: flex;
    align-items: center; justify-content: center;
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 2rem;
}
.flashcard-front { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: var(--white); }
.flashcard-back { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: var(--white); transform: rotateY(180deg); }
.flashcard-front h3, .flashcard-back h3 { font-size: 1.75rem; text-align: center; }
.flashcard-nav { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* =========================================
   Phrasebook
   ========================================= */
.phrase-category { margin-bottom: 2rem; }
.phrase-category h3 { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; color: var(--primary); }
.phrase-category h3 i { color: var(--accent); }
.phrase-list { display: grid; gap: 0.75rem; }
.phrase-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; background: var(--white);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.phrase-item:hover { box-shadow: var(--shadow); transform: translateX(4px); }
.phrase-native { font-weight: 600; color: var(--text-primary); }
.phrase-translation { color: var(--text-secondary); font-size: 0.95rem; }

/* =========================================
   Dictionary
   ========================================= */
.dictionary-result { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow); }
.dictionary-word { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.dictionary-phonetic { color: var(--text-muted); font-size: 1.125rem; margin-bottom: 1.5rem; }
.dictionary-part-of-speech {
    display: inline-block; background: var(--primary); color: var(--white);
    padding: 0.25rem 0.75rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem;
}
.dictionary-definition { padding-left: 1rem; border-left: 3px solid var(--primary); margin: 1rem 0; }
.dictionary-example { font-style: italic; color: var(--text-secondary); padding-left: 1rem; border-left: 2px solid var(--gray-200); }

/* =========================================
   Translator
   ========================================= */
.language-pair { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.swap-btn {
    background: var(--gray-100); border: none; width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.swap-btn:hover { background: var(--primary); color: var(--white); }

/* =========================================
   Reading
   ========================================= */
.reading-passage { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow); margin-bottom: 2rem; font-size: 1.0625rem; line-height: 1.8; }
.reading-question { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.reading-question h4 { margin-bottom: 1rem; }

/* =========================================
   Typing Test
   ========================================= */
.typing-area {
    background: var(--white); border-radius: var(--radius-xl);
    padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.typing-text {
    font-size: 1.5rem; line-height: 2; color: var(--text-secondary);
    margin-bottom: 1.5rem; word-wrap: break-word;
}
.typing-text .current { background: var(--primary); color: var(--white); padding: 0 2px; border-radius: 2px; }
.typing-text .correct { color: #22c55e; }
.typing-text .incorrect { color: #ef4444; text-decoration: underline; }
.typing-input {
    width: 100%; padding: 1rem; font-size: 1.25rem;
    border: 2px solid var(--gray-200); border-radius: var(--radius-lg);
    outline: none; transition: var(--transition);
}
.typing-input:focus { border-color: var(--primary); }
.typing-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1rem; }
.typing-stat { text-align: center; }
.typing-stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.typing-stat-label { font-size: 0.875rem; color: var(--text-muted); }

/* =========================================
   Page Header
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white); padding: 3rem 0; text-align: center;
}
.page-header h1 { color: var(--white); font-size: 2.5rem; margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.9); font-size: 1.125rem; margin-bottom: 0; }

/* =========================================
   Tool Specific
   ========================================= */
.tool-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl); display: flex; align-items: center;
    justify-content: center; margin: 0 auto 1.5rem;
}
.tool-icon i { font-size: 2.5rem; color: var(--white); }
.tool-icon.accent { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); }

.tool-input-area { margin-bottom: 1.5rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.form-textarea { min-height: 150px; resize: vertical; }
.form-select { cursor: pointer; }

.tool-controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-controls .btn { flex: 1; min-width: 120px; }

.tool-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.slider-group { margin-bottom: 1rem; }
.slider-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.slider-value { float: right; font-weight: 600; color: var(--primary); }

.range-slider {
    width: 100%; height: 8px; border-radius: 4px;
    background: var(--gray-200); outline: none; -webkit-appearance: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: var(--primary); cursor: pointer;
}

.tool-result-box {
    background: var(--cream); border-radius: var(--radius-lg);
    padding: 1.5rem; margin-top: 1.5rem;
}
.result-highlight {
    background: var(--primary); color: var(--white);
    padding: 0.5rem 1rem; border-radius: var(--radius);
    display: inline-block; margin-bottom: 1rem;
}

.tool-nav { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tool-nav a {
    padding: 0.5rem 1rem; background: var(--gray-100); border-radius: var(--radius);
    font-size: 0.875rem; color: var(--text-secondary);
}
.tool-nav a:hover { background: var(--primary); color: var(--white); }

/* =========================================
   Quiz Styles
   ========================================= */
.quiz-question {
    background: var(--white); border-radius: var(--radius-xl); padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.quiz-question h4 { margin-bottom: 1rem; font-size: 1.125rem; }
.quiz-options { display: grid; gap: 0.75rem; }
.quiz-option {
    padding: 1rem; background: var(--gray-50); border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg); cursor: pointer; transition: var(--transition);
}
.quiz-option:hover { border-color: var(--primary); background: var(--white); }
.quiz-option.correct { border-color: #22c55e; background: #dcfce7; }
.quiz-option.incorrect { border-color: #ef4444; background: #fee2e2; }
.quiz-progress {
    height: 8px; background: var(--gray-200); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 1.5rem;
}
.quiz-progress-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }

/* =========================================
   Flashcard Styles
   ========================================= */
.flashcard-container { perspective: 1000px; margin: 2rem 0; }
.flashcard {
    width: 100%; max-width: 500px; height: 300px; margin: 0 auto;
    position: relative; transform-style: preserve-3d;
    transition: transform 0.6s; cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; display: flex;
    align-items: center; justify-content: center;
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 2rem;
}
.flashcard-front { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: var(--white); }
.flashcard-back { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: var(--white); transform: rotateY(180deg); }
.flashcard-front h3, .flashcard-back h3 { font-size: 1.75rem; text-align: center; }
.flashcard-nav { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* =========================================
   Phrasebook
   ========================================= */
.phrase-category { margin-bottom: 2rem; }
.phrase-category h3 { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; color: var(--primary); }
.phrase-category h3 i { color: var(--accent); }
.phrase-list { display: grid; gap: 0.75rem; }
.phrase-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; background: var(--white);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.phrase-item:hover { box-shadow: var(--shadow); transform: translateX(4px); }
.phrase-native { font-weight: 600; color: var(--text-primary); }
.phrase-translation { color: var(--text-secondary); font-size: 0.95rem; }

/* =========================================
   Dictionary
   ========================================= */
.dictionary-result { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow); }
.dictionary-word { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.dictionary-phonetic { color: var(--text-muted); font-size: 1.125rem; margin-bottom: 1.5rem; }
.dictionary-part-of-speech {
    display: inline-block; background: var(--primary); color: var(--white);
    padding: 0.25rem 0.75rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem;
}
.dictionary-definition { padding-left: 1rem; border-left: 3px solid var(--primary); margin: 1rem 0; }
.dictionary-example { font-style: italic; color: var(--text-secondary); padding-left: 1rem; border-left: 2px solid var(--gray-200); }

/* =========================================
   Translator
   ========================================= */
.language-pair { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.swap-btn {
    background: var(--gray-100); border: none; width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.swap-btn:hover { background: var(--primary); color: var(--white); }

/* =========================================
   Reading
   ========================================= */
.reading-passage { background: var(--white); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow); margin-bottom: 2rem; font-size: 1.0625rem; line-height: 1.8; }
.reading-question { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.reading-question h4 { margin-bottom: 1rem; }

/* =========================================
   Typing Test
   ========================================= */
.typing-area {
    background: var(--white); border-radius: var(--radius-xl);
    padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.typing-text {
    font-size: 1.5rem; line-height: 2; color: var(--text-secondary);
    margin-bottom: 1.5rem; word-wrap: break-word;
}
.typing-text .current { background: var(--primary); color: var(--white); padding: 0 2px; border-radius: 2px; }
.typing-text .correct { color: #22c55e; }
.typing-text .incorrect { color: #ef4444; text-decoration: underline; }
.typing-input {
    width: 100%; padding: 1rem; font-size: 1.25rem;
    border: 2px solid var(--gray-200); border-radius: var(--radius-lg);
    outline: none; transition: var(--transition);
}
.typing-input:focus { border-color: var(--primary); }
.typing-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1rem; }
.typing-stat { text-align: center; }
.typing-stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.typing-stat-label { font-size: 0.875rem; color: var(--text-muted); }
