/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background: rgba(114, 36, 8, 1);
    color: #762b0d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}



/* Navigation styles */
nav {
    background: rgba(114, 36, 8, 1);
    padding: 0.8rem 2rem;
    position: relative;
    z-index: 10;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fdf2de;
}

.logo-wordspring {
    height: 55px;
    width: auto;
    max-width: 280px;
    margin: -0.3rem 0;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

/* Removed vertical border lines from navbar */

.nav-links a {
    color: #f8e0c7;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s ease;
    padding: 0.8rem 1.5rem;
    display: block;
    position: relative;
}

.nav-links a:hover {
    color: #d4af86;
}

.nav-links a.active {
    color: #d4af86;
    font-weight: 500;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: #d4af86;
}

/* Header styles for landing page */
.hero-section {
    background: 
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
        url('bgtest.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    width: 100%;
    position: relative;
}

.hero-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 2rem;
    color: #fdf2de;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    text-align: left;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.cta-button.secondary {
    background: transparent;
    color: #fdf2de;
    border: 2px solid rgba(253, 242, 222, 0.7);
}

.cta-button.secondary:hover {
    background: rgba(253, 242, 222, 0.1);
    border-color: #fdf2de;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.language-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.language-card {
    background: rgba(253, 242, 222, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(253, 242, 222, 0.2);
    text-align: center;
    transition: all 0.3s ease;
    margin: 0.5rem 0;
}

.language-card:hover {
    background: rgba(253, 242, 222, 0.15);
    transform: translateY(-2px);
}

.language-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #d4af86;
    font-weight: 400;
}

.language-card p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.language-card .translation {
    font-size: 0.85rem;
    color: rgba(253, 242, 222, 0.8);
    font-style: italic;
}

/* Header styles for translator page */
header {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(114, 36, 8, 0.95);
    color: #fdf2de;
    position: relative;

    backdrop-filter: blur(10px);
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

h1 small {
    font-size: 1rem;
    color: #d4af86;
    font-style: italic;
    opacity: 0.9;
    font-weight: 300;
}

.mission {
    font-style: italic;
    color: #d4af86;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Translator form card styles */
.translator-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: 16px;

    border: 1px solid rgba(139, 111, 71, 0.1);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.translator-card:hover {
    transform: translateY(-2px);

}

/* Legacy container for compatibility */
.container {
    flex: 1;
    max-width: 900px;
    width: 95%;
    margin: 1rem auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
    border: none;
}

/* Input section */
.input-section {
    padding: 0;
    background: transparent;
}

.description {
    text-align: center;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.4;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

select:focus, textarea:focus {
    border-color: #8b6f47;

    outline: none;
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Button styles */
button {
    background: linear-gradient(135deg, #8b6f47 0%, #6b4e3d 100%);
    color: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);

}

button:active {
    transform: translateY(-1px);
}

.button-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

button:hover .button-icon {
    transform: translateX(4px);
}

/* Loading overlay for translator */
.translator-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 72px; /* Exclude the action buttons area */
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.translator-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 3.5rem;
    background: transparent;
    border-radius: 16px;
    transform: translateY(0);
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}

.spinner {
    border: 4px solid rgba(139, 111, 71, 0.2);
    border-top: 4px solid #8b6f47;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1.2s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-spinner p {
    color: #762b0d;
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Simple fade animation */
@keyframes simpleFade {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.translation-result.animate p {
    opacity: 0;
    animation: simpleFade 1.2s ease-out forwards;
}

/* Result section */
.result-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: 16px;

    border: 1px solid rgba(139, 111, 71, 0.1);
    transition: all 0.3s ease;
}

.result-section h2 {
    color: #762b0d;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 400;
}

.translation-container {
    position: relative;
    background: rgba(139, 111, 71, 0.08);
    padding: 1.3rem;
    border-radius: 10px;
    border-left: 3px solid #8b6f47;
    margin-bottom: 1rem;
}

#translation {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
    color: #762b0d;
}

.copy-button {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(139, 111, 71, 0.1);
    border: 1px solid rgba(139, 111, 71, 0.3);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.copy-button:hover {
    background: rgba(139, 111, 71, 0.2);
    transform: scale(1.1);
}

/* References section */
.references-details {
    background: white;
    border-radius: 12px;
    overflow: hidden;

    border: 1px solid #e9ecef;
}

.references-details summary {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #8b6f47 0%, #6b4e3d 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

.references-details summary:hover {
    background: linear-gradient(135deg, #6b4e3d 0%, #5a3f32 100%);
}

.references-details summary::after {
    content: '▼';
    position: absolute;
    right: 2rem;
    transition: transform 0.3s ease;
}

.references-details[open] summary::after {
    transform: rotate(180deg);
}

#references {
    list-style: none;
    padding: 1.5rem;
    background: #f8f9fa;
}

#references li {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    background: white;
    transition: all 0.3s ease;

}

#references li:hover {
    background: rgba(139, 111, 71, 0.05);
    transform: translateY(-2px);

}

#references li:last-child {
    margin-bottom: 0;
}

/* Footer */
footer {
    background: rgba(114, 36, 8, 1);
    color: #fdf2de;
    padding: 3rem 1.5rem;
    margin-top: 0;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

footer p {
    line-height: 1.4;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.contact {
    font-size: 0.9rem;
}

footer a {
    color: #d4af86;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

footer a:hover {
    color: white;
    background: rgba(212, 175, 134, 0.2);
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 950px) {
    header {
        padding: 0.6rem 1rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h1 small {
        font-size: 0.85rem;
    }
    
    .mission {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .container {
        margin: 0.8rem auto;
        width: 98%;
    }
    
    .input-section, .result-section {
        padding: 1rem;
    }
    
    .translation-container {
        padding: 1rem;
    }
    
    #translation {
        font-size: 1rem;
    }
    
    textarea {
        min-height: 70px;
    }
}

/* Very small iPhone screens - all sections behave the same */
@media (max-width: 414px) {
    /* Mission sections inherit from normal about section styling - no special rules needed */
}

@media (max-width: 480px) {
    .logo-wordspring {
        content: url('wordspring.jpg');
    }
    
    /* Very small screens - ensure commitment section doesn't cause horizontal scroll */
    .commitment-section {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        overflow-x: hidden;
        min-width: 100vw;
    }
    
    /* No special mission styling - all sections behave the same */
    
    .language-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .language-card {
        min-width: 150px;
        padding: 1rem;
    }
    
    /* iPhone specific optimizations */
    .language-selector {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
        background: #fefbf5 !important;
        align-items: center !important;
    }
    
    .language-input {
        order: 1 !important;
    }
    
    .swap-languages {
        order: 2 !important;
        width: 2.5rem !important;
        height: 2.5rem !important;
        min-width: 2.5rem !important;
        min-height: 2.5rem !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .language-output {
        order: 3 !important;
    }
    
    .swap-icon {
        font-size: 1.1rem !important;
    }
    
    .language-card h3 {
        font-size: 0.9rem;
    }
    
    .language-card p {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Very small mobile translator improvements */
    .translator-page {
        padding: 0.5rem;
    }
    
    .translator-header h1 {
        font-size: 1.5rem;
    }
    
    #input-text, .translation-result {
        min-height: 100px;
        font-size: 0.95rem;
    }
    
    .input-actions, .output-actions {
        padding: 1rem 0.5rem;
        gap: 0.5rem;
    }
    
    #translate-button {
        min-width: 100px;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    footer {
        padding: 2rem 1rem;
    }
    
    footer p {
        font-size: 0.8rem;
    }
    
    .contact {
        font-size: 0.85rem;
    }
    
    .translator-page {
        padding: 1.5rem 1rem;
    }
    
    .language-selector {
        padding: 1rem;
    }
}

/* Translator page styles */
.translator-page {
    background: rgba(253, 242, 222, 0.95);
    min-height: calc(100vh - 120px);
    padding: 4rem 2rem 5rem 2rem;
}

.translator-container {
    max-width: 1000px;
    margin: 0 auto;
}

.translator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.translator-header h1 {
    font-size: 2.5rem;
    color: #762b0d;
    margin-bottom: 1rem;
    font-weight: 400;
}

.translator-header .subtitle {
    font-size: 1.2rem;
    color: #8b6f47;
    font-style: italic;
}

/* Google Translate Style Interface */
.translator-interface {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(139, 111, 71, 0.2);
    position: relative;
}

.language-selector {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem;
    background: #fefbf5;
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
    gap: 1.5rem;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    background: white;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    color: #762b0d;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Georgia, serif;
    transition: all 0.3s ease;
}
    
.dropdown-selected:hover {
    border-color: #999;
}
    
.dropdown-arrow {
    font-size: 0.8rem;
    color: #762b0d;
    transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-dropdown.active .dropdown-options {
    display: block;
}

.custom-dropdown.active .dropdown-selected {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    color: #762b0d;
    font-family: Georgia, serif;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option.selected {
    background-color: #e6e6e6;
    font-weight: 500;
}

.swap-languages {
    background: none;
    border: none;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
    color: #762b0d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-languages:hover {
    background: rgba(118, 43, 13, 0.1);
}

.swap-languages.flipped {
    transform: rotate(180deg);
}

.swap-icon {
    font-size: 1.5rem;
    display: block;
}

.translation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 300px;
    position: relative;
}

.input-panel, .output-panel {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-panel {
    border-right: 1px solid rgba(139, 111, 71, 0.1);
}

.input-panel textarea {
    flex: 1;
    border: none;
    padding: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    background: transparent;
    color: #762b0d;
    font-family: Georgia, serif;
}

.input-panel textarea:focus {
    outline: none;
}

.translation-result {
    flex: 1;
    padding: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #762b0d;
    background: #ffffff;
    font-family: Georgia, serif;
}

.translation-result .placeholder {
    color: #999;
    font-style: italic;
    margin: 0;
}

.translation-result .error {
    color: #d32f2f;
    font-style: italic;
    margin: 0;
}

.input-actions, .output-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: #ffffff;
    border-top: 1px solid rgba(139, 111, 71, 0.1);
    height: 72px;
    box-sizing: border-box;
}

.clear-btn, .copy-btn {
    background: none;
    border: none;
    color: #762b0d;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: Georgia, serif;
    outline: none;
    box-shadow: none;
}

.clear-btn:hover, .copy-btn:hover {
    background: rgba(118, 43, 13, 0.1);
}



#translate-button {
    background: #762b0d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: Georgia, serif;
}

#translate-button:hover {
    background: #5a1f08;
    transform: translateY(-1px);
}

#translate-button:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

#translate-button:disabled:hover {
    background: #ccc;
    transform: none;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #d4af86;
    font-style: italic;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: rgba(253, 242, 222, 0.95);
    color: #762b0d;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 2px;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(118, 43, 13, 0.2);
}



.cta-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);

}

.features {
    padding: 4rem 2rem;
    background: rgba(253, 242, 222, 0.95);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #762b0d;
    margin-bottom: 3rem;
    font-weight: 400;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #faedd9;
    padding: 2rem;
    border-radius: 16px;

    transition: all 0.3s ease;
    border: 1px solid rgba(139, 111, 71, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);

}



.feature-card h3 {
    font-size: 1.5rem;
    color: #762b0d;
    margin-bottom: 1rem;
    font-weight: 400;
}

.feature-card p {
    color: #6b4e3d;
    line-height: 1.6;
    font-size: 1rem;
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    background: none !important;
    background-image: none !important;
    border: none;
    color: #fdf2de;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: none !important;
    transform: none !important;
    overflow: visible !important;
}

.mobile-menu-toggle::before {
    display: none !important;
    content: none !important;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus,
.mobile-menu-toggle:active,
.mobile-menu-toggle:visited {
    background: none !important;
    background-color: transparent !important;
    color: #fdf2de !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
    filter: none !important;
}


/* Mobile logo switching */
@media (max-width: 950px) {
    .logo-wordspring {
        content: url('wordspring.jpg');
    }
}

/* When screen is not full laptop resolution, make mission section completely normal */
@media (max-width: 1400px) {
    /* Hide the images when not full resolution */
    .about-image-left,
    .about-image-right {
        display: none !important;
    }
    
    /* Reset mission section to be completely normal - remove ALL special styling */
    .about-section.has-image-left,
    .about-section.has-image-right {
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        min-height: auto !important;
        max-height: none !important;
        background: none !important;
        overflow: visible !important;
        margin-bottom: 3rem !important;
        flex-direction: column !important;
        align-items: unset !important;
        gap: unset !important;
    }
    
    /* Remove ALL special content styling - let it inherit from .about-section naturally */
    .about-section.has-image-left .section-content,
    .about-section.has-image-right .section-content {
        padding: 0 2.5rem 0.5rem 2.5rem !important;
        flex: none !important;
        width: auto !important;
        background: none !important;
        justify-content: flex-start !important;
        display: block !important;
    }
    
    /* Make commitment section text responsive */
    .commitment-section .section-content h2 {
        font-size: 1.6rem !important;
    }
    
    .commitment-section .section-content p {
        font-size: 1rem !important;
    }
}

/* Tablet responsive for commitment section */
@media (max-width: 1100px) {
    .commitment-section .section-content h2 {
        font-size: 1.5rem !important;
    }
    
    .commitment-section .section-content p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
}

/* Mobile responsiveness for navigation */
@media (max-width: 950px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 2rem;
        background: rgba(114, 36, 8, 1);
        flex-direction: column;
        gap: 0;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        margin: 0;
        padding: 0;
        min-width: 180px;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        border: none;
        border-bottom: 1px solid rgba(246, 231, 212, 0.3);
        width: 100%;
        background: transparent;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links li:nth-child(1),
    .nav-links li:nth-child(2),
    .nav-links li:nth-child(3),
    .nav-links li:nth-child(4) {
        background: transparent;
    }
    
    .nav-links a {
        padding: 0.9rem 1.25rem;
        display: block;
        width: 100%;
        box-sizing: border-box;
        color: #f6e7d4 !important;
        text-decoration: none;
        transition: background-color 0.2s ease, color 0.2s ease;
        font-size: 0.9rem;
        text-align: left;
        border-radius: 0;
        margin: 0;
    }
    
    .nav-links a:hover {
        background: rgba(246, 231, 212, 0.1) !important;
        color: #f6e7d4 !important;
    }
    
    .nav-links a.active {
        background: rgba(246, 231, 212, 0.15) !important;
        color: #f6e7d4 !important;
        font-weight: 500;
    }
    
    .nav-links a.active::after {
        display: none;
    }
    
    .hero-header {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .hero-section {
        background-attachment: scroll;
        min-height: auto;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .language-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        overflow-x: visible;
        padding: 1rem;
        max-height: none;
    }
    
    .language-card {
        min-width: 180px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .translator-page {
        padding: 1rem 1rem 3rem 1rem;
    }
    
    .translator-container {
        max-width: 100%;
        padding: 0;
    }
    
    .translator-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .translator-header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .translator-header .subtitle {
        font-size: 0.9rem;
    }
    
    .translation-area {
        grid-template-columns: 1fr;
        gap: 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(118, 43, 13, 0.1);
    }
    
    .input-panel, .output-panel {
        border-right: none;
        border-bottom: 1px solid rgba(139, 111, 71, 0.1);
        padding: 1rem;
    }
    
    .output-panel {
        border-bottom: none;
    }
    
    .language-selector {
        grid-template-columns: 1fr auto 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
        background: #fefbf5;
        align-items: center;
    }
    
    .language-input {
        order: 1;
    }
    
    .swap-languages {
        order: 2;
        align-self: center;
        margin: 0.5rem 0;
        width: 3rem !important;
        height: 3rem !important;
        min-width: 3rem !important;
        min-height: 3rem !important;
        flex-shrink: 0 !important;
    }
    
    .language-output {
        order: 3;
    }
    
    .logo-wordspring {
        height: 50px;
        max-width: 250px;
        margin: -0.2rem 0;
        object-fit: contain;
    }
    
    /* Mobile textarea and input improvements */
    #input-text {
        min-height: 120px;
        font-size: 1rem;
        border: none;
        resize: vertical;
        padding: 1rem;
    }
    
    .translation-result {
        min-height: 120px;
        font-size: 1rem;
        padding: 1rem;
    }
    
    /* Mobile button improvements */
    .input-actions, .output-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        justify-content: space-between;
        background: #ffffff;
        height: 60px;
        box-sizing: border-box;
        align-items: center;
    }
    
    .input-actions {
        border-top: 1px solid rgba(139, 111, 71, 0.1);
    }
    
    .output-actions {
        border-top: 1px solid rgba(139, 111, 71, 0.1);
    }
    
    .clear-btn, .copy-btn {
        min-width: 60px !important;
        padding: 0.7rem 1.2rem !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
    }
    
    #translate-button {
        min-width: 120px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        border-radius: 8px;
        flex: 1;
        max-width: 200px;
    }
    
    /* Ensure dropdown doesn't overflow on mobile */
    .custom-dropdown {
        min-width: 0;
        flex: 1;
    }
    
    .dropdown-selected {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        color: #762b0d;
        border: 1px solid #ddd;
    }
    
    .dropdown-options {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .dropdown-option {
        padding: 1rem;
        font-size: 0.95rem;
        color: #762b0d;
    }
    
    /* Mobile about page fixes */
    .about-page {
        padding: 2rem 1rem 0rem 1rem;
    }
    
    .about-content {
        padding: 2rem 0 0 0;
    }
    
    /* Research page mobile - stack titles above text */
    .research-content {
        padding: 2rem 2rem;
    }
    
    .research-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .research-title {
        flex: none;
        padding-right: 0;
        margin-bottom: 1rem;
        text-align: left;
    }
    
    .languages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .language-item {
        padding: 1.25rem;
    }
    
    /* Mobile about page - all sections behave the same */
    .about-section .section-content {
        padding: 0 1.5rem 2rem 1.5rem !important;
    }
    
    /* Mobile commitment section */
    .commitment-section {
        background-attachment: scroll !important;
        padding: 0 !important;
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        margin-bottom: 0 !important;
        position: relative;
        left: 0;
        right: 0;
    }
    
    .commitment-section .section-content {
        padding: 3rem 1.5rem 4rem 1.5rem !important;
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
        box-sizing: border-box;
    }
    
    .commitment-section .section-content h2 {
        font-size: 1.4rem !important;
    }
    
    .commitment-section .section-content p {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }
    
    .about-section:not(.commitment-section) .section-content {
        padding: 0 1.5rem 2rem 1.5rem !important;
    }
}

/* About page styles */
.about-page {
    background: rgba(253, 242, 222, 0.95);
    min-height: calc(100vh - 120px);
    padding: 3rem 2rem 0rem 2rem;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
}

.about-header {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.about-header h1 {
    font-size: 2.5rem;
    color: #762b0d;
    margin-bottom: 1rem;
    font-weight: 400;
}

.about-header .subtitle {
    font-size: 1.2rem;
    color: #8b6f47;
    font-style: italic;
}

.about-content {
    padding: 3rem 0 0 0;
}

/* Research page styling */
.research-content {
    padding: 3rem 4rem;
}

.research-section {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4rem;
    gap: 2rem;
}

.research-title {
    flex: 0 0 30%;
    font-size: 1.8rem;
    color: #762b0d;
    margin: 0;
    font-weight: 400;
    text-align: right;
    padding-right: 1.5rem;
}

.research-text {
    flex: 1;
}

.research-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #6b4e3d;
    margin-bottom: 1.5rem;
    font-family: Georgia, serif;
}

.research-text p:last-child {
    margin-bottom: 0;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 1.8rem;
    color: #762b0d;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #6b4e3d;
    margin-bottom: 1.5rem;
    font-family: Georgia, serif;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.language-item {
    background: rgba(253, 242, 222, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 111, 71, 0.1);
}

.language-item h3 {
    font-size: 1.3rem;
    color: #762b0d;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.language-item p {
    font-size: 1rem;
    margin-bottom: 0;
    color: #8b6f47;
}

/* About page image styles - full-width layout */
.about-section {
    margin-bottom: 3rem;
    overflow: hidden;
}

.about-section:last-child {
    margin-bottom: 0;
}

/* Only image sections get full-width treatment */
.about-section.has-image-left,
.about-section.has-image-right {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 500px;
    max-height: 500px;
    margin-bottom: 3rem;
}

.about-section.has-image-left {
    flex-direction: row;
}

.about-section.has-image-right {
    flex-direction: row-reverse;
}

.about-image-left,
.about-image-right {
    width: 60%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    min-width: 300px;
}

/* Text content positioning */
.about-section .section-content {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Remove padding for image sections */
.about-section.has-image-left .section-content,
.about-section.has-image-right .section-content {
    padding: 2.5rem 2.5rem 2.5rem 4rem; /* Extra left padding for better spacing from image */
    justify-content: center;
}

/* Text styling for image sections - normal sizing */
.about-section.has-image-left .section-content h2,
.about-section.has-image-right .section-content h2 {
    font-size: 1.8rem;
    color: #762b0d;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.about-section.has-image-left .section-content p,
.about-section.has-image-right .section-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #6b4e3d;
    margin-bottom: 1.5rem;
    font-family: Georgia, serif;
}

.about-section.has-image-left .section-content p:last-child,
.about-section.has-image-right .section-content p:last-child {
    margin-bottom: 0;
}

/* Regular about sections without images */
.about-section:not(.has-image-left):not(.has-image-right):not(.commitment-section) .section-content {
    padding: 0 2.5rem 0.5rem 2.5rem;
}

/* Commitment section with background image */
.commitment-section {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('imgtest3.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    width: 100vw !important;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 0;
    margin-top: 4rem;
    padding: 4rem 0 0 0;
}

.commitment-section .section-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem 2rem;
    color: #fdf2de;
    text-align: center;
}

.commitment-section .section-content h2 {
    color: #fdf2de;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.commitment-section .section-content p {
    color: #fdf2de;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-family: Georgia, serif;
}

.commitment-section .section-content p:last-child {
    margin-bottom: 0;
}

/* Animation for smooth transitions */
.container, .result-section, .loading-spinner {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Page load animations - triggered by JavaScript */
.page-loaded .hero-content {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.page-loaded .hero-visual {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.page-loaded .language-card {
    animation: fadeInUp 0.6s ease-out both;
}

.page-loaded .language-card:nth-child(1) { animation-delay: 0.1s; }
.page-loaded .language-card:nth-child(2) { animation-delay: 0.2s; }
.page-loaded .language-card:nth-child(3) { animation-delay: 0.3s; }
.page-loaded .language-card:nth-child(4) { animation-delay: 0.4s; }
.page-loaded .language-card:nth-child(5) { animation-delay: 0.5s; }
.page-loaded .language-card:nth-child(6) { animation-delay: 0.6s; }

.page-loaded .translator-container {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.page-loaded .features .feature-card:nth-child(1) { animation-delay: 0.1s; }
.page-loaded .features .feature-card:nth-child(2) { animation-delay: 0.3s; }
.page-loaded .features .feature-card:nth-child(3) { animation-delay: 0.5s; }

/* Synchronized animations for about and research pages */
.page-loaded .about-header {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.page-loaded .about-content {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.page-loaded .research-content {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.page-loaded .about-section:nth-child(1) { animation-delay: 0.1s; }
.page-loaded .about-section:nth-child(2) { animation-delay: 0.2s; }
.page-loaded .about-section:nth-child(3) { animation-delay: 0.3s; }
.page-loaded .commitment-section { 
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.page-loaded .language-item {
    animation: fadeInUp 0.6s ease-out both;
}

.page-loaded .language-item:nth-child(1) { animation-delay: 0.1s; }
.page-loaded .language-item:nth-child(2) { animation-delay: 0.2s; }
.page-loaded .language-item:nth-child(3) { animation-delay: 0.3s; }
.page-loaded .language-item:nth-child(4) { animation-delay: 0.4s; }
.page-loaded .language-item:nth-child(5) { animation-delay: 0.5s; }
.page-loaded .language-item:nth-child(6) { animation-delay: 0.6s; }

/* Elements start hidden until page loads */
.hero-content,
.hero-visual,
.language-card,
.translator-container,
.feature-card,
.about-header,
.about-content,
.research-content,
.about-section,
.commitment-section,
.language-item {
    opacity: 0;
    transform: translateY(30px);
}

/* Show elements immediately when page-loaded class is added */
.page-loaded .hero-content,
.page-loaded .hero-visual,
.page-loaded .language-card,
.page-loaded .translator-container,
.page-loaded .feature-card,
.page-loaded .about-header,
.page-loaded .about-content,
.page-loaded .research-content,
.page-loaded .about-section,
.page-loaded .commitment-section,
.page-loaded .language-item {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 430px) {
  .hero-section .language-preview {
    grid-template-columns: 1fr;
    padding: 1rem 0.5rem;
  }

  .hero-section .language-card {
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0 auto;
  }

  .hero-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* 防止整体溢出 */
  .hero-section {
    overflow-x: hidden;
  }
}

