* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
    background-color: #f5f5f5;
    color: #2e2e38;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.top-header {
    background-color: #ffffff;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.header-logo {
    background-color: #1a1a24;
    display: flex;
    height: 40px;
    min-width: 40px;
    width: 40px;
    border-radius: 4px;
}

.header-logo a {
    display: inline-flex;
    height: 100%;
    padding: 5px;
    text-decoration: none;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: #2e2e38;
}

.back-link {
    color: #2e2e38;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    background-color: #f0f0f0;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: #e0e0e0;
}

/* Translator Container */
.translator-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px;
}

/* Input Section */
.input-section {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: #2e2e38;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-label::before {
    content: "🇬🇧";
    font-size: 20px;
}

.speak-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: #747480;
    transition: all 0.2s;
}

.speak-btn:hover {
    background-color: #f0f0f0;
    color: #2e2e38;
}

.speak-btn.speaking {
    color: #2e7d32;
    animation: pulse 1s infinite;
}

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

.input-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-textarea:focus {
    outline: none;
    border-color: #2e2e38;
}

.translate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 16px 24px;
    background-color: #2e2e38;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.translate-btn:hover {
    background-color: #1a1a24;
}

.translate-btn:disabled {
    background-color: #c4c4c4;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #747480;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #2e2e38;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Translations Grid */
.translations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

/* Translation Card */
.translation-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeIn 0.3s ease;
}

.translation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

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

.language-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2e2e38;
}

.language-flag {
    font-size: 24px;
}

.card-speak-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    color: #747480;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-speak-btn:hover {
    background-color: #f0f0f0;
    color: #2e2e38;
}

.card-speak-btn.speaking {
    color: #2e7d32;
    background-color: #e8f5e9;
    animation: pulse 1s infinite;
}

.card-speak-btn:disabled {
    color: #c4c4c4;
    cursor: not-allowed;
}

.translation-text {
    font-size: 18px;
    line-height: 1.6;
    color: #2e2e38;
    word-break: break-word;
}

/* Language-specific font sizes for better readability */
.translation-text.chinese {
    font-size: 22px;
}

.translation-text.kannada,
.translation-text.malayalam,
.translation-text.bengali {
    font-size: 20px;
}

.translation-text.error {
    color: #d32f2f;
    font-size: 14px;
}

/* Language-specific colors */
.translation-card.spanish { border-left: 4px solid #c60b1e; }
.translation-card.polish { border-left: 4px solid #dc143c; }
.translation-card.czech { border-left: 4px solid #11457e; }
.translation-card.kannada { border-left: 4px solid #ff9933; }
.translation-card.malayalam { border-left: 4px solid #ff6600; }
.translation-card.bengali { border-left: 4px solid #006a4e; }
.translation-card.chinese { border-left: 4px solid #de2910; }

/* Info Section */
.info-section {
    margin-top: 32px;
    text-align: center;
    color: #747480;
    font-size: 13px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
}

.info-section p {
    margin-bottom: 8px;
}

/* Footer */
footer {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 24px;
    flex-shrink: 0;
    margin-top: auto;
}

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

.footer-text {
    text-align: right;
}

.body-3-light {
    font-weight: 300;
    font-size: 12px;
    color: #747480;
}

/* Responsive */
@media (max-width: 768px) {
    .translator-container {
        padding: 16px;
    }

    .translations-grid {
        grid-template-columns: 1fr;
    }

    .app-title {
        font-size: 16px;
    }
}
