/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.75rem;
}

.notes-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.notes-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 2rem;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 4rem;
}

.welcome-content {
    max-width: 600px;
    margin: 0 auto;
}

.welcome-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.highlight {
    color: var(--accent-color);
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.welcome-subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section-header p {
    font-size: 1.125rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

/* Language Section */
.language-section {
    margin-bottom: 4rem;
}

.language-selector {
    display: flex;
    justify-content: center;
}

.modern-select {
    appearance: none;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    min-width: 300px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modern-select:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Scenario Section */
.scenario-section {
    margin-bottom: 4rem;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.scenario-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.scenario-card:hover::before {
    transform: scaleX(1);
}

.scenario-card.active {
    border-color: var(--primary-color);
    border-width: 2px;
    background: #f8f9fa;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
    transform: translateY(-3px) scale(1.02);
    position: relative;
}

.scenario-card.active .scenario-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.scenario-card.active h3 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

.scenario-card.active p {
    color: var(--text-primary);
    font-weight: 500;
}

.scenario-card.active::before {
    transform: scaleX(1);
}

.scenario-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat Section */
.chat-section {
    margin-bottom: 2rem;
}

.chat-containers {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    min-height: 500px;
    border: 1px solid var(--border-light);
}

.chat-container {
    height: 500px;
    overflow-y: auto;
    padding: 2rem;
    display: none;
}

.chat-container.active {
    display: block;
}

.chat-message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    justify-content: flex-end;
}

.system-message {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.user-message .chat-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.system-message .chat-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-bubble.business {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: #93c5fd;
}

.chat-bubble.friends {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #86efac;
}

.chat-bubble.flirt {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    border-color: #f9a8d4;
}

/* Chat Controls */
.chat-controls {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.message-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mic-button {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 0.5rem;
    position: relative;
}


.mic-button:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}



.mic-button:active {
    transform: translateY(0);
}

.mic-button.listening {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
    color: white;
    animation: pulse 1s infinite;
}


.mic-button.listening:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    border-color: #c0392b;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.send-btn {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: var(--shadow-md);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.send-btn:active {
    transform: translateY(0);
}

/* Notes Panel */
.notes-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.notes-panel.open {
    right: 0;
}

.notes-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.notes-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-notes-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.close-notes-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notes-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.notes-list {
    list-style: none;
    margin-bottom: 2rem;
}

.notes-list li {
    background: var(--bg-secondary);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.notes-list li:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.add-note-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.note-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.note-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.add-note-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.add-note-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-2xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Formatted Output Styles */
.formatted-output h3 {
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: var(--text-primary);
}

/* Simple translation styling */

.translation-text {
    color: #6b7280;
    font-weight: 500;
    background: #f9fafb;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85em;
    font-style: italic;
    display: inline-block;
    margin: 2px 0;
    border-left: 3px solid #d1d5db;
}

/* Word highlighting and translation popup */
.clickable-word {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #7c2d12;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #f59e0b;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    margin: 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clickable-word:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.word-translation-popup {
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    font-family: 'Inter', sans-serif;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-content {
    padding: 16px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.popup-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1em;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.popup-body {
    color: #374151;
}

.translation {
    font-size: 1em;
    margin-bottom: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.add-to-notes {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.add-notes-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

.add-notes-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.add-notes-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quoted-text {
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0.25rem 0;
}

.original-text {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .main-container {
        padding: 7rem 1.5rem 2rem;
    }
    
    .scenario-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .chat-container {
        height: 450px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .main-container {
        padding: 6rem 1rem 2rem;
    }
    
    .welcome-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .welcome-subtitle {
        font-size: 1.125rem;
        padding: 0 1rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .scenario-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .scenario-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .scenario-card h3 {
        font-size: 1.375rem;
    }
    
    .scenario-card p {
        font-size: 0.95rem;
    }
    
    .chat-container {
        height: 400px;
        padding: 1rem;
    }
    
    .chat-bubble {
        max-width: 85%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .notes-panel {
        width: 100%;
        right: -100%;
    }
    
    .header-content {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .notes-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .notes-btn span {
        display: none;
    }
    
    .modern-select {
        min-width: 280px;
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
    
    .input-container {
        gap: 0.75rem;
    }
    
    .message-input {
        font-size: 0.95rem;
        padding: 0.875rem 1.25rem;
    }
    
    .mic-button {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1rem;
    }
    
    .send-btn {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .main-container {
        padding: 5.5rem 0.75rem 1.5rem;
    }
    
    .welcome-title {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        padding: 0 0.5rem;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.375rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }
    
    .language-section, .scenario-section {
        margin-bottom: 3rem;
    }
    
    .modern-select {
        min-width: 100%;
        max-width: 300px;
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
        margin: 0 0.5rem;
    }
    
    .scenario-grid {
        padding: 0;
        gap: 1rem;
    }
    
    .scenario-card {
        padding: 1.25rem;
        margin: 0;
        border-radius: var(--radius-xl);
    }
    
    .scenario-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .scenario-card p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .scenario-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .chat-containers {
        margin-bottom: 1.5rem;
        border-radius: var(--radius-xl);
    }
    
    .chat-container {
        height: 350px;
        padding: 0.75rem;
    }
    
    .chat-bubble {
        max-width: 90%;
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
        border-radius: var(--radius-lg);
    }
    
    .chat-controls {
        padding: 1rem;
        border-radius: var(--radius-xl);
    }
    
    .input-container {
        gap: 0.5rem;
    }
    
    .message-input {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-lg);
    }
    
    .mic-button {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    .send-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    .notes-panel {
        width: 100%;
        right: -100%;
    }
    
    .notes-header {
        padding: 1.5rem;
    }
    
    .notes-header h2 {
        font-size: 1.125rem;
    }
    
    .notes-content {
        padding: 1.5rem;
    }
    
    .notes-list li {
        padding: 0.875rem;
        margin-bottom: 0.625rem;
        font-size: 0.9rem;
    }
    
    .note-input {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
    
    .add-note-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }
    
    .header-content {
        padding: 0.75rem 1rem;
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .notes-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        border-radius: var(--radius-md);
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .main-container {
        padding: 5rem 0.5rem 1rem;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .welcome-subtitle {
        font-size: 0.9rem;
    }
    
    .section-header h2 {
        font-size: 1.375rem;
    }
    
    .section-header p {
        font-size: 0.85rem;
    }
    
    .scenario-card {
        padding: 1rem;
    }
    
    .scenario-card h3 {
        font-size: 1.125rem;
    }
    
    .scenario-card p {
        font-size: 0.8rem;
    }
    
    .scenario-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
    
    .chat-container {
        height: 300px;
        padding: 0.5rem;
    }
    
    .chat-bubble {
        max-width: 95%;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .message-input {
        font-size: 0.85rem;
        padding: 0.625rem 0.875rem;
    }
    
    .mic-button, .send-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.85rem;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 4rem 1rem 1rem;
    }
    
    .welcome-section {
        margin-bottom: 2rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .language-section, .scenario-section {
        margin-bottom: 2rem;
    }
    
    .scenario-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .scenario-card {
        padding: 1rem;
    }
    
    .scenario-card h3 {
        font-size: 1.125rem;
    }
    
    .scenario-card p {
        font-size: 0.8rem;
    }
    
    .scenario-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .chat-container {
        height: 250px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Focus States */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Improve touch targets */
    .scenario-card {
        min-height: 120px;
        touch-action: manipulation;
    }
    
    .mic-button, .send-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .notes-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .add-note-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px;
    }
    
    /* Improve scrolling */
    .chat-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .notes-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better button states for touch */
    .scenario-card:active {
        transform: translateY(-2px) scale(0.98);
    }
    
    .mic-button:active, .send-btn:active {
        transform: translateY(0) scale(0.95);
    }
    
    .notes-btn:active {
        transform: scale(0.95);
    }
    
    /* Improve text selection */
    .chat-bubble {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Better spacing for mobile */
    .welcome-section {
        margin-bottom: 3rem;
    }
    
    .language-section {
        margin-bottom: 3rem;
    }
    
    .scenario-section {
        margin-bottom: 3rem;
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    /* Ensure proper viewport handling */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Improve form elements */
    .modern-select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* Better touch feedback */
    .scenario-card {
        transition: all 0.2s ease;
    }
    
    .scenario-card:active {
        background: #f8f9fa;
        transform: scale(0.98);
    }
    
    /* Improve readability */
    .chat-bubble {
        line-height: 1.4;
    }
    
    .scenario-card p {
        line-height: 1.4;
    }
    
    /* Better spacing for very small screens */
    .main-container > section {
        margin-bottom: 2rem;
    }
    
    .main-container > section:last-child {
        margin-bottom: 1rem;
    }
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* Question prompts styling */
.question-prompts {
    margin: 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.prompts-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-button {
    display: inline-block;
    margin: 0.25rem 0.5rem 0.25rem 0;
    padding: 0.5rem 1rem;
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prompt-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.prompt-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* Dark mode support for prompts */
@media (prefers-color-scheme: dark) {
    .question-prompts {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .prompts-label {
        color: #94a3b8;
    }
    
    .prompt-button {
        background: #334155;
        color: #e2e8f0;
        border-color: #475569;
    }
    
    .prompt-button:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
}

/* Mobile responsiveness for prompts */
@media (max-width: 768px) {
    .question-prompts {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }
    
    .prompt-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin: 0.2rem 0.4rem 0.2rem 0;
    }
}

/* Word highlighting and translation popup styles */
.clickable-word {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-bottom: 2px solid transparent;
}

.clickable-word:hover {
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.3) 100%);
    border-bottom-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.word-translation-popup {
    position: fixed;
    z-index: 1000;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-content {
    padding: 0;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    border-radius: 12px 12px 0 0;
}

.popup-header .word {
    font-weight: 600;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 16px;
}

.translation {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.add-to-notes {
    text-align: center;
}

.add-notes-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
}

.add-notes-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.add-notes-btn:active {
    transform: translateY(0);
}

/* Dark mode support for popup */
@media (prefers-color-scheme: dark) {
    .word-translation-popup {
        background: #1f2937;
        border-color: #374151;
    }
    
    .translation {
        background: #374151;
        color: #f9fafb;
    }
    
    .translation-text {
        color: #9ca3af;
        background: #374151;
        border-left-color: #4b5563;
    }
}

/* Mobile responsiveness for popup */
@media (max-width: 480px) {
    .word-translation-popup {
        min-width: 200px;
        max-width: 90vw;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    .popup-header {
        padding: 10px 12px;
    }
    
    .popup-body {
        padding: 12px;
    }
}
