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

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: left;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 400;
    color: #1a73e8;
    margin-bottom: 5px;
}

.header h1 i {
    margin-right: 8px;
}

.subtitle {
    font-size: 14px;
    color: #5f6368;
}

.translator-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    padding: 0;
    overflow: hidden;
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8eaed;
    padding: 16px 24px;
    gap: 16px;
}

.lang-box {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: #5f6368;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-box.active {
    background: transparent;
    color: #1a73e8;
    font-weight: 500;
}

.lang-box i {
    margin-right: 6px;
    font-size: 16px;
}

.swap-button {
    width: 40px;
    height: 40px;
    background: transparent;
    color: #5f6368;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swap-button:hover {
    background: #f1f3f4;
}

.translation-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
}

.divider {
    width: 1px;
    background: #e8eaed;
}

.input-section {
    position: relative;
    border-bottom: 1px solid #e8eaed;
}

#inputText {
    width: 100%;
    height: 180px;
    padding: 24px;
    border: none;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    color: #202124;
    line-height: 1.6;
}

#inputText::placeholder {
    color: #9aa0a6;
}

.char-count {
    position: absolute;
    bottom: 8px;
    right: 24px;
    font-size: 12px;
    color: #9aa0a6;
}

.output-section {
    position: relative;
    border-bottom: 1px solid #e8eaed;
}

.output-text {
    width: 100%;
    height: 180px;
    padding: 24px;
    border: none;
    font-size: 16px;
    background: #f8f9fa;
    overflow-y: auto;
    color: #5f6368;
    line-height: 1.6;
}

.output-text.has-content {
    color: #202124;
    background: #f8f9fa;
}

.copy-btn {
    position: absolute;
    bottom: 8px;
    right: 24px;
    padding: 8px 12px;
    background: transparent;
    color: #1a73e8;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #f1f3f4;
}

.copy-btn i {
    margin-right: 4px;
}

.button-container {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    justify-content: flex-start;
}

.translate-btn,
.clear-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.translate-btn {
    background: #1a73e8;
    color: white;
}

.translate-btn:hover:not(:disabled) {
    background: #1765cc;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.translate-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.clear-btn {
    background: transparent;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.clear-btn:hover {
    background: #f1f3f4;
}

.loading {
    text-align: center;
    color: #1a73e8;
    font-weight: 400;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 14px;
}

.loading i {
    font-size: 16px;
}

.error {
    background: #fce8e6;
    color: #c5221f;
    padding: 12px 24px;
    font-size: 14px;
    border-left: 4px solid #c5221f;
}

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

    .header {
        padding: 12px 0;
    }

    .header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
    }

    .translator-box {
        border-radius: 4px;
    }

    .translation-container {
        grid-template-columns: 1fr;
    }

    .divider {
        display: none;
    }

    .language-selector {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .lang-box {
        font-size: 13px;
        padding: 6px 10px;
    }

    .swap-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    #inputText,
    .output-text {
        height: 140px;
        padding: 16px;
        font-size: 15px;
    }

    .char-count {
        right: 16px;
        bottom: 8px;
    }

    .button-container {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .translate-btn,
    .clear-btn {
        font-size: 13px;
        padding: 8px 20px;
    }

    .copy-btn {
        right: 16px;
        bottom: 8px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .loading {
        padding: 12px 16px;
        font-size: 13px;
    }

    .error {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Scrollbar Styling */
#inputText::-webkit-scrollbar,
.output-text::-webkit-scrollbar {
    width: 6px;
}

#inputText::-webkit-scrollbar-track,
.output-text::-webkit-scrollbar-track {
    background: transparent;
}

#inputText::-webkit-scrollbar-thumb,
.output-text::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

#inputText::-webkit-scrollbar-thumb:hover,
.output-text::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}
