/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip link for accessibility and SEO */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4A90E2;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

html {
    /* Prevent zooming on iOS when focusing inputs */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    /* Better font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Language Selection Page */
.language-selection-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

.app-header h1 {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.app-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.language-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 500px;
    width: 100%;
}

.language-form h2 {
    text-align: center;
    color: #4A90E2;
    margin-bottom: 10px;
    font-size: 2rem;
}

.language-form > p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.language-group {
    margin-bottom: 25px;
}

.language-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.language-select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px; /* Prevents iOS zoom */
    background: white;
    transition: border-color 0.3s ease;
}

.language-select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.start-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 144, 226, 0.3);
}

.start-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Main Page Layout */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-content h1 {
    color: #4A90E2;
    font-size: 2rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-button {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    color: #666;
    font-size: 1.1rem;
}

.icon-button:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
}

.main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    gap: 30px;
    padding: 30px;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    height: fit-content;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.topic-info h3 {
    color: #4A90E2;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.topic-card {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.topic-day {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.topic-text {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
}

.next-topic, .countdown {
    margin-top: 25px;
}

.next-topic h4, .countdown h4 {
    color: #666;
    margin-bottom: 10px;
    font-size: 1rem;
}

.topic-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #555;
}

/* Bubble Styling for Tomorrow's Topic and Next Topic */
.bubble-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bubble-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4A90E2, #357ABD, #FF6B6B, #4ECDC4);
    background-size: 200% 100%;
    animation: bubble-gradient 3s ease-in-out infinite;
}

.bubble-section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.bubble-title {
    color: #2c3e50 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bubble-title::before {
    content: '💭';
    font-size: 1.2rem;
    opacity: 0.8;
}

.next-topic .bubble-title::before {
    content: '📅';
}

.countdown .bubble-title::before {
    content: '⏰';
}

.bubble-content {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 15px !important;
    padding: 18px !important;
    font-size: 1rem !important;
    color: #34495e !important;
    font-weight: 500;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.bubble-content:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.01);
}

.timer.bubble-content {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem !important;
    font-weight: bold;
    text-align: center;
    color: #e74c3c !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 240, 240, 0.8)) !important;
    border: 2px solid rgba(231, 76, 60, 0.3);
}

@keyframes bubble-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced bubble animation on hover */
.bubble-section:hover::before {
    animation-duration: 1.5s;
}

/* Responsive bubble design */
@media (max-width: 768px) {
    .bubble-section {
        padding: 15px;
        margin: 15px 0;
        border-radius: 15px;
    }
    
    .bubble-content {
        padding: 15px !important;
        font-size: 0.95rem !important;
    }
    
    .timer.bubble-content {
        font-size: 1.2rem !important;
    }
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4A90E2;
    text-align: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

.topic-list {
    margin-top: 30px;
}

.topic-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.topic-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.topic-item:hover {
    background: #e9ecef;
}

.topic-item.current {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
}

.topic-item-day {
    font-weight: 600;
    margin-right: 10px;
    min-width: 50px;
}

.topic-item-text {
    font-size: 0.9rem;
    flex: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.menu-container h2 {
    text-align: center;
    color: #4A90E2;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.activity-grid {
    display: grid;
    gap: 25px;
    max-width: 600px;
    margin: 0 auto;
}

.activity-card {
    display: flex;
    align-items: center;
    padding: 25px;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.activity-card:hover {
    border-color: #4A90E2;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.15);
}

.card-icon {
    font-size: 2.5rem;
    color: #4A90E2;
    margin-right: 20px;
    min-width: 70px;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.card-content p {
    color: #666;
    font-size: 0.95rem;
}

.quiz-status, .vocab-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #4A90E2;
    font-weight: 500;
}

.card-arrow {
    font-size: 1.2rem;
    color: #4A90E2;
    margin-left: 15px;
}

/* Chat Page */
.chat-layout {
    display: flex;
    height: 100vh;
}

.chat-sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
}

.chat-right-panel {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    background: rgba(255, 255, 255, 0.95);
}

.back-button {
    background: none;
    border: none;
    color: #4A90E2;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    font-size: 0.95rem;
}

.back-button:hover {
    background: rgba(74, 144, 226, 0.1);
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
}

.message.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.message-content {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.user-message .message-content {
    background: #4A90E2;
    color: white;
}

.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.tts-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.tts-button:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #4A90E2;
}

.coffee-link {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.coffee-link a {
    color: #8B4513;
    text-decoration: none;
    font-size: 0.9rem;
}

.coffee-link a:hover {
    text-decoration: underline;
}

.chat-input-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e1e5e9;
}

.input-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

#messageInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    resize: none;
    font-family: inherit;
    font-size: 16px; /* Prevents iOS zoom */
    line-height: 1.4;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #4A90E2;
}

.input-buttons {
    display: flex;
    gap: 5px;
}

.voice-button, .send-button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.voice-button {
    background: #28a745;
    color: white;
}

.voice-button:hover {
    background: #218838;
    transform: scale(1.05);
}

.send-button {
    background: #4A90E2;
    color: white;
}

.send-button:hover {
    background: #357ABD;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Grammar Panel */
.grammar-panel h3 {
    color: #4A90E2;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.grammar-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    min-height: 200px;
}

.grammar-placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.grammar-suggestion {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #ffc107;
}

.grammar-correction {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #dc3545;
}

/* Quiz Page */
.quiz-container, .vocabulary-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    background: linear-gradient(135deg, #fafafa 0%, #f0f2f5 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.quiz-header, .vocabulary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    background: rgba(255,255,255,0.8);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.quiz-progress, .vocabulary-progress {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    color: #4A90E2;
}

.quiz-content, .vocabulary-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.quiz-question {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

.quiz-options {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.quiz-option {
    padding: 1.2rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    text-align: left;
    font-size: 1.05rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    line-height: 1.5;
    color: #495057;
}

.quiz-option:hover {
    border-color: #4A90E2;
    background: linear-gradient(135deg, #f8f9fa, #e3f2fd);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.15);
}

.quiz-option.selected {
    border-color: #4A90E2;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.quiz-option.correct {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.quiz-option.incorrect {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.option-letter {
    font-weight: 700;
    color: #4A90E2;
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.quiz-button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.primary-button {
    background: #4A90E2;
    color: white;
}

.primary-button:hover {
    background: #357ABD;
}

.primary-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.secondary-button {
    background: #6c757d;
    color: white;
}

.secondary-button:hover {
    background: #5a6268;
}

.danger-button {
    background: #dc3545;
    color: white;
}

.danger-button:hover {
    background: #c82333;
}

.quiz-results {
    text-align: center;
    padding: 30px;
}

.results-score {
    font-size: 3rem;
    font-weight: bold;
    color: #4A90E2;
    margin-bottom: 20px;
}

.results-message {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

.daily-limit-message {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.quiz-completed-today {
    text-align: center;
    padding: 30px;
    color: #666;
}

.quiz-completed-today h3 {
    color: #28a745;
    margin-bottom: 15px;
}

/* Vocabulary Styles */
.vocab-word-card {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.vocab-word {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.vocab-pronunciation {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.vocab-definition {
    font-size: 1.1rem;
    line-height: 1.4;
}

.vocab-examples {
    margin-top: 2rem;
    background: linear-gradient(135deg, #f8f9fa, #e3f2fd);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #FF6B6B;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.1);
}

.vocab-examples h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vocab-examples h4::before {
    content: "💡";
    font-size: 1.2rem;
}

.vocab-example {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    font-style: italic;
    color: #495057;
    font-size: 1.05rem;
    line-height: 1.6;
    border-left: 3px solid #FF6B6B;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.vocab-example:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vocab-example:last-child {
    margin-bottom: 0;
}

/* New Vocabulary Display Styles */
.vocabulary-display-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.vocab-main-header {
    text-align: center;
    margin-bottom: 30px;
}

.vocab-section-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.vocab-word-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.word-title-section {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.word-title-label {
    color: #666;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.word-title-display {
    color: #2c3e50;
    font-size: 3rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.pronunciation-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.pronunciation-btn {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.pronunciation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.phonetic-display {
    font-family: 'Times New Roman', serif;
    font-size: 1.3rem;
    color: #555;
    font-weight: 500;
}

.definition-section,
.translation-section {
    margin-bottom: 20px;
    padding: 15px 0;
}

.definition-label,
.translation-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.definition-text,
.translation-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057;
    margin: 0;
}

.interactive-learning-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.learning-section-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-examples-title {
    color: #666;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.examples-container {
    margin-bottom: 20px;
}

.example-item {
    background: linear-gradient(135deg, #f8f9fa, #e3f2fd);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid #4A90E2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.example-text {
    font-style: italic;
    color: #495057;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

.vocab-quiz-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.quiz-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.quiz-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 15px;
}

.quiz-options {
    display: grid;
    gap: 10px;
}

.quiz-option {
    background: white;
    border: 2px solid #dee2e6;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 1rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.quiz-option:hover {
    border-color: #4A90E2;
    background: #f0f8ff;
    transform: translateY(-1px);
}

.quiz-option:disabled {
    cursor: not-allowed;
}

.quiz-option.correct-answer {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.quiz-option.incorrect-answer {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.quiz-feedback {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.vocab-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.vocab-info {
    color: #666;
    font-weight: 500;
}

.vocab-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.back-button,
.vocab-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button {
    background: #6c757d;
    color: white;
}

.back-button:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.vocab-button.primary-button {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.vocab-button.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.loading-exercises {
    text-align: center;
    padding: 40px 20px;
}

.loading-dots {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 15px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4A90E2;
    display: inline-block;
    animation: loading-bounce 1.4s ease-in-out both infinite;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design for Vocabulary */
@media (max-width: 768px) {
    .vocabulary-display-container {
        padding: 15px;
    }
    
    .vocab-word-section,
    .interactive-learning-section,
    .vocab-quiz-section {
        padding: 20px 15px;
    }
    
    .word-title-display {
        font-size: 2.5rem;
    }
    
    .pronunciation-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .vocab-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .vocab-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    color: #4A90E2;
    font-size: 1.3rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.setting-group input[type="checkbox"] {
    margin-right: 10px;
}

/* Voice Recording */
.recording-controls {
    text-align: center;
}

.recording-status {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #666;
}

.recording-visual {
    width: 100px;
    height: 100px;
    border: 3px solid #e1e5e9;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.recording-visual.active {
    border-color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.recording-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.record-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.record-button:hover {
    background: #c82333;
}

.stop-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.stop-button:hover {
    background: #5a6268;
}

.transcription {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    min-height: 60px;
    font-style: italic;
    color: #666;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 20px;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .chat-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .chat-sidebar,
    .chat-right-panel {
        width: 100%;
        order: 2;
    }
    
    .chat-main {
        order: 1;
        min-height: 70vh;
    }
    
    .app-header h1 {
        font-size: 2.5rem;
    }
    
    .language-form {
        margin: 20px;
        padding: 30px;
    }
    
    .quiz-container,
    .vocabulary-container {
        padding: 20px;
    }
    
    .quiz-content,
    .vocabulary-content {
        padding: 25px;
    }
    
    .activity-grid {
        padding: 0 10px;
    }
    
    .activity-card {
        padding: 20px;
    }
    
    .card-icon {
        font-size: 2rem;
        min-width: 60px;
        margin-right: 15px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .language-form {
        padding: 20px;
    }
    
    .start-button {
        padding: 15px;
        font-size: 16px;
    }
    
    .activity-card {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .card-arrow {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .quiz-header,
    .vocabulary-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quiz-controls {
        flex-direction: column;
        gap: 15px;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #4A90E2;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Focus Styles for Accessibility */
button:focus,
select:focus,
textarea:focus,
input:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .activity-card {
        border-width: 3px;
    }
    
    .message-content {
        border: 1px solid #333;
    }
    
    .quiz-option {
        border-width: 3px;
    }
}

/* Enhanced Vocabulary Styles for Large Datasets */
.word-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.word-rank {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.vocab-rank {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    margin-top: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.vocab-stats {
    background: var(--background-light);
    padding: 10px 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9em;
    color: var(--text-light);
    border-left: 4px solid var(--primary-color);
}

.dataset-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.dataset-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.dataset-info p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
}

.vocabulary-options {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.vocab-option {
    background: white;
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.vocab-option:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.vocab-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Vocabulary Word Card Styles */
.word-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.word-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.pronunciation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: #495057;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 500;
    border-left: 4px solid #4A90E2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    text-align: center;
    letter-spacing: 0.5px;
}

.word-meanings {
    background: linear-gradient(135deg, #fafafa, #f1f3f4);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.original-definition,
.native-translation {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
}

.original-definition:last-child,
.native-translation:last-child {
    margin-bottom: 0;
}

.definition-label,
.translation-label {
    font-weight: 700;
    color: #2c3e50;
    margin-right: 0.8rem;
    display: inline-block;
    min-width: 90px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.definition-text {
    color: #2c3e50;
    font-size: 1.05rem;
    line-height: 1.6;
    display: inline-block;
    max-width: calc(100% - 90px);
    vertical-align: top;
}

.translation-text {
    color: #28a745;
    font-weight: 600;
    font-size: 1.15rem;
    display: inline-block;
    max-width: calc(100% - 90px);
    vertical-align: top;
    line-height: 1.5;
}

/* Enhanced Exercises Section */
.vocab-exercises-section {
    margin: 1.5rem 0;
}

.exercises-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.exercises-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.exercises-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.exercises-container {
    min-height: 200px;
}

.loading-exercises {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loading-dots {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4A90E2;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Exercise Cards */
.exercise-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.exercise-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.exercise-card:hover {
    border-color: #4A90E2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.exercise-card.example-card:hover { border-color: #28a745; }
.exercise-card.practice-card:hover { border-color: #ffc107; }
.exercise-card.info-card:hover { border-color: #17a2b8; }

.exercise-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.exercise-content {
    flex: 1;
}

.exercise-content h5 {
    margin: 0 0 0.8rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.sentence-example {
    margin: 0.5rem 0;
    padding: 0.3rem 0;
    color: #495057;
    line-height: 1.5;
}

.fill-blank {
    background: #fff3cd;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #ffc107;
}

.practice-input {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}

.practice-input:focus {
    border-color: #4A90E2;
    outline: none;
}

.word-stat {
    display: flex;
    justify-content: space-between;
    margin: 0.3rem 0;
    padding: 0.2rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: bold;
    color: #2c3e50;
}

/* Modern Exercise Grid - Simplified Layout */
.modern-exercise-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin: 1.5rem 0;
}

.exercise-tile {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.exercise-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.exercise-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    border-color: #4A90E2;
}

.example-tile:hover::before { background: linear-gradient(90deg, #28a745, #20c997); }
.practice-tile:hover::before { background: linear-gradient(90deg, #ffc107, #fd7e14); }
.memory-tile:hover::before { background: linear-gradient(90deg, #6f42c1, #e83e8c); }
.quiz-tile:hover::before { background: linear-gradient(90deg, #17a2b8, #6610f2); }

.tile-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
}

.tile-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tile-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.tile-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Example Sentences Styling */
.example-sentence {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 0.8rem 0;
    padding: 0.8rem;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 12px;
    border-left: 4px solid #28a745;
}

.example-number {
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.example-sentence p {
    margin: 0;
    color: #495057;
    line-height: 1.5;
}

/* Practice Section Styling */
.practice-prompt {
    background: rgba(255, 193, 7, 0.1);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid #ffc107;
    color: #856404;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.practice-textarea {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.practice-textarea:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.check-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.check-btn:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Memory Section Styling */
.memory-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.memory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(108, 117, 125, 0.05);
    border-radius: 10px;
}

.memory-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

.memory-value {
    font-weight: 500;
}

.word-highlight {
    color: #6f42c1;
    font-size: 1.1rem;
    font-weight: 700;
}

.translation-highlight {
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 600;
}

.frequency-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.frequency-badge.rank-very-high { background: #dc3545; }
.frequency-badge.rank-high { background: #fd7e14; }
.frequency-badge.rank-medium { background: #ffc107; color: #212529; }
.frequency-badge.rank-low { background: #6c757d; }

/* Quiz Section Styling */
.quiz-question {
    background: rgba(23, 162, 184, 0.1);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
    font-weight: 500;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quiz-option {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
    position: relative;
}

.quiz-option:hover {
    border-color: #17a2b8;
    background: rgba(23, 162, 184, 0.05);
    transform: translateX(5px);
}

.quiz-option:disabled {
    cursor: not-allowed;
}

.quiz-option.selected-correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.quiz-option.selected-wrong {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.quiz-option.show-correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.15);
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Enhanced Pronunciation Section */
.pronunciation-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 12px;
    border-left: 4px solid #4A90E2;
}

.pronunciation-btn {
    background: linear-gradient(145deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pronunciation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.pronunciation-btn:active {
    transform: translateY(0);
}

.phonetic {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    color: #495057;
    font-weight: 500;
}

/* Enhanced Back Button and Controls */
.vocab-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.back-button {
    background: linear-gradient(145deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background: linear-gradient(145deg, #495057, #343a40);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Vocabulary Lock Screen Styles */
.vocabulary-locked-screen {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    margin: 2rem 0;
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.vocabulary-locked-screen h3 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.daily-progress-summary {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.progress-bar-large {
    background: rgba(255, 255, 255, 0.2);
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill-large {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.next-session-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.locked-tips {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
    text-align: left;
}

.locked-tips ul {
    list-style: none;
    padding: 0;
}

.locked-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.locked-tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Enhanced Vocabulary Results */
.vocabulary-results {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px;
    margin: 2rem 0;
}

.daily-progress {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 15px;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.vocabulary-locked {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.vocabulary-locked h4 {
    margin: 0 0 1rem 0;
    color: #ffc107;
}

/* Responsive Design for Simplified Exercise Cards */
@media (min-width: 768px) {
    .modern-exercise-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .example-tile {
        grid-column: 1 / -1;
    }
    
    .quiz-tile {
        min-height: 200px;
    }
}

@media (min-width: 1200px) {
    .modern-exercise-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .example-tile {
        grid-column: 1 / -1;
    }
}

/* Enhanced Chinese Vocabulary Styles */
.chinese-vocab .chinese-word-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    border: 2px solid #e1e8ff;
}

.chinese-characters-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.simplified-chinese, .traditional-chinese {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.simplified-chinese h4, .traditional-chinese h4 {
    color: #5a67d8;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chinese-character-large {
    font-size: 4rem !important;
    font-weight: 300;
    color: #2d3748;
    margin: 10px 0;
    font-family: 'Microsoft YaHei', 'SimHei', 'STHeiti', sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.pinyin-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
}

.pinyin-section h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}

.pinyin-display {
    font-size: 2.5rem !important;
    font-weight: 400;
    margin: 15px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.pronunciation-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.pronunciation-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.meaning-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
    border-left: 5px solid #4299e1;
}

.meaning-section h4 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.meaning-text {
    font-size: 18px;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.level-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 12px;
}

.hsk-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.level-section small {
    color: #744210;
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive Design for Chinese Vocabulary */
@media (max-width: 768px) {
    .chinese-characters-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .chinese-character-large {
        font-size: 3rem !important;
    }
    
    .pinyin-display {
        font-size: 2rem !important;
    }
    
    .chinese-word-card {
        padding: 20px;
        margin: 10px;
    }
}

/* Enhanced Quiz Styling for Chinese */
.chinese-vocab .vocab-quiz-section {
    margin-top: 30px;
}

.chinese-vocab .quiz-option {
    font-size: 16px;
    padding: 15px 20px;
    margin: 8px 0;
    background: linear-gradient(145deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.chinese-vocab .quiz-option:hover {
    background: linear-gradient(145deg, #e6fffa 0%, #b2f5ea 100%);
    border-color: #38b2ac;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 178, 172, 0.2);
}

.chinese-vocab .quiz-option.correct {
    background: linear-gradient(145deg, #f0fff4 0%, #c6f6d5 100%);
    border-color: #48bb78;
    color: #22543d;
}

.chinese-vocab .quiz-option.incorrect {
    background: linear-gradient(145deg, #fffaf0 0%, #fed7d7 100%);
    border-color: #f56565;
    color: #742a2a;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ======================================== */

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-layout {
        gap: 20px;
        padding: 20px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        padding: 30px;
    }
    
    .menu-container h2 {
        font-size: 2rem;
    }
    
    .activity-card {
        padding: 20px;
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    /* Language Selection Page */
    .app-header h1 {
        font-size: 2.5rem;
    }
    
    .app-header p {
        font-size: 1rem;
    }
    
    .language-form {
        padding: 25px;
        margin: 10px;
    }
    
    .language-form h2 {
        font-size: 1.5rem;
    }
    
    /* Main Page Layout */
    .main-header {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .main-layout {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .menu-container h2 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }
    
    .activity-grid {
        gap: 15px;
    }
    
    .activity-card {
        padding: 18px;
    }
    
    .card-icon {
        font-size: 2rem;
        min-width: 50px;
        margin-right: 15px;
    }
    
    .card-content h3 {
        font-size: 1.1rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }
    
    /* Topic Cards */
    .topic-card {
        padding: 15px;
    }
    
    .topic-text {
        font-size: 1rem;
    }
    
    /* Quiz and Vocabulary Pages */
    .quiz-container, .vocabulary-container {
        padding: 1rem;
    }
    
    .quiz-header, .vocabulary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 1rem;
    }
    
    .quiz-header h2, .vocabulary-header h2 {
        font-size: 1.5rem;
    }
    
    .quiz-content, .vocabulary-content {
        padding: 20px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .quiz-option {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .option-letter {
        min-width: 25px;
        height: 25px;
        font-size: 0.85rem;
    }
    
    .vocab-word {
        font-size: 2rem;
    }
    
    .vocab-pronunciation {
        font-size: 1rem;
    }
    
    .vocab-definition {
        font-size: 1rem;
    }
    
    /* Results and Messages */
    .results-score {
        font-size: 2.5rem;
    }
    
    .results-message {
        font-size: 1.1rem;
    }
}

/* Small Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .language-form {
        padding: 20px;
    }
    
    .menu-container h2 {
        font-size: 1.5rem;
    }
    
    .activity-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .card-arrow {
        display: none;
    }
    
    .quiz-option {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
    
    .vocab-word {
        font-size: 1.8rem;
    }
}

/* Landscape Mobile Fix */
@media (max-height: 500px) and (orientation: landscape) {
    .main-layout {
        padding: 10px;
    }
    
    .sidebar {
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .menu-container h2 {
        margin-bottom: 15px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .icon-button {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }
    
    .activity-card {
        min-height: 100px;
    }
    
    .quiz-option {
        min-height: 50px;
    }
    
    /* Remove hover effects on touch devices */
    .activity-card:hover {
        transform: none;
    }
    
    .quiz-option:hover {
        transform: none;
    }
    
    /* Better button sizing */
    .start-button,
    .primary-button,
    .quiz-button {
        min-height: 50px;
        font-size: 16px;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .page {
        min-height: -webkit-fill-available;
    }
    
    .chat-layout {
        height: -webkit-fill-available;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .main-header,
    .icon-button,
    .back-button,
    .chat-input-container,
    .coffee-button,
    .coffee-section {
        display: none !important;
    }
}