body {
    font-family: 'Lato', sans-serif;
    background: #f0f2f5;
    padding-top: 20px;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    margin: 0 0 1rem 0;
}

h2 {
    color: #444;
    margin-top: 30px;
    margin-bottom: 15px;
}

ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
}

p {
    margin-bottom: 15px;
}

nav {
    background: white;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), 
               0 1px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 2rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    position: relative;
}

.nav-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-link.active {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #4CAF50;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.nav-link.active:hover::after {
    width: 30px;
}

.logo-menu {
    position: absolute;
    top: calc(100% - 10px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 0.8rem;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 200px;
    visibility: hidden;
    transition-delay: 0s;
}

.logo-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

.logo-container:hover .logo-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s;
}

.logo-menu:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s;
}

.menu-button {
    display: block;
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    color: #666;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.menu-button:hover {
    background: #f8f9fa;
    color: #4CAF50;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: #f0f2f5;
    transform: translateY(-1px);
}

.user-info span {
    color: #444;
    font-weight: 500;
}

.user-info .profile-picture {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.user-info:hover .profile-picture {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

form#clear-form {
    margin: 0;
}

.logo-menu a {
    text-decoration: none;
    margin: 0;
}

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


.translation-settings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-button {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.mode-indicator {
    font-size: 0.9rem;
    color: #666;
    text-align: right;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.translate-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    margin-left: 0.5rem;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.translate-button:hover {
    color: #4CAF50;
}

.translation {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f5f5f5;
    border-left: 3px solid #4CAF50;
    font-style: italic;
    color: #666;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Remove old mode selector styles from chat container */
.chat-container .mode-selector {
    display: none;
}

.tutor-response {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.tutor-response section {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-left: 3px solid #4CAF50;
}

.tutor-response h4 {
    color: #2E7D32;
    margin: 0.5rem 0;
}

.vocabulary-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.grammar-note {
    background: #E8F5E9;
    padding: 0.5rem;
    border-radius: 4px;
}

.cultural-note {
    background: #FFF3E0;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Text-to-speech button styles */
.tts-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.tts-button:hover {
    background-color: #357ab8;
}

.tts-button:active {
    background-color: #2a5d8f;
}


/* Translation Page Styles */
.practice-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.practice-header {
    margin-bottom: 2rem;
}

.practice-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-badge {
    background: #4CAF50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.language-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
}

.language-controls select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-controls select:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.25);
}

#swap-languages {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

#swap-languages:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    transform: rotate(180deg);
}

.practice-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 250px);
    min-height: 500px;
}

.conversation-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.panel-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.conversation-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    /* padding: 1rem; */
    border-radius: 12px;
    position: relative;
}

.user-message {
    background: #f0f2f5;
    align-self: flex-end;
}

.ai-message {
    background: #e3f2fd;
    align-self: flex-start;
}

.message-content {
    position: relative;
}

.message-content p {
    margin: 0;
    padding-right: 80px;
    line-height: 1.5;
}

.message-meta {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.language-tag {
    font-weight: 500;
    color: #4CAF50;
}

.control-button {
    position: absolute;
    top: 0;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.3rem;
    transition: all 0.2s ease;
}

.control-button:hover {
    color: #4CAF50;
    transform: scale(1.1);
}

.speak-text, .speak-translation {
    right: 40px;
}

.copy-text, .copy-translation {
    right: 0;
}

.input-panel {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.answer-input {
    flex: 1;
    min-height: 60px;
    max-height: 150px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.answer-input:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76,175,80,0.25);
}

.check-answer-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-answer-btn:hover {
    background: #43A047;
    transform: translateY(-2px);
}

.hint-btn {
    background: #f0f2f5;
    color: #666;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hint-btn:hover {
    background: #e0e0e0;
}

/* Floating microphone button */
.floating-mic-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.floating-mic-button:hover {
    transform: scale(1.1);
    background: #43A047;
}

.floating-mic-button.recording {
    background: #f44336;
    animation: pulse 1.5s infinite;
}

.floating-mic-status {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: none;
    z-index: 1000;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244,67,54,0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(244,67,54,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244,67,54,0);
    }
}

/* Dropdown Menu Styles */
.menu-toggle-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}
.menu-toggle-bar:hover .toggle-icon {
    transform: translateY(2px);
}

.menu-toggle-bar:hover {
    background: #43A047;
    height: 25px;
}

.active-page-indicator {
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.dropdown-nav {
    background: white;
    padding: 1rem 2rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: fixed;
    top: -100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: top 0.2s ease;
}

.menu-toggle-bar:hover + .dropdown-nav,
.dropdown-nav:hover {
    top: 20px;
}

.mic-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #e0e0e0;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-top: 4px;
    flex-shrink: 0;
}

.btn {
    margin-top: 10px;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}


.btn.active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #4299e1;
}

/* Buttons */
.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* Alert Styles */
.alert {
    position: relative;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: #E8F5E9;
    border: 1px solid #A5D6A7;
    color: #2E7D32;
}

.alert-success .alert-icon {
    color: #2E7D32;
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.alert.fade {
    transition: opacity 0.15s linear;
}

.alert.fade.show {
    opacity: 1;
}

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

/* Alert variants */
.alert-info {
    background-color: #E3F2FD;
    border: 1px solid #90CAF9;
    color: #1565C0;
}

.alert-warning {
    background-color: #FFF3E0;
    border: 1px solid #FFCC80;
    color: #E65100;
}

.alert-danger {
    background-color: #FFEBEE;
    border: 1px solid #FFCDD2;
    color: #C62828;
}

/* Alert with icon */
.alert-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.alert-info .alert-icon {
    color: #1565C0;
}

.alert-warning .alert-icon {
    color: #E65100;
}

.alert-danger .alert-icon {
    color: #C62828;
}

/* Alert content */
.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    margin: 0;
}


.flash-messages {
    margin-bottom: 1rem;
}

.flash-message {
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}