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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.api-key-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.input-group input {
    flex: 1;
    min-width: 300px;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group button {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.input-group button:hover {
    background: #5a6fd8;
}

.api-key-help {
    margin-top: 15px;
}

.api-key-help details {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 0;
}

.api-key-help summary {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.api-key-help summary:hover {
    background: #e9ecef;
}

.help-content {
    padding: 15px;
    border-top: 1px solid #e1e5e9;
    background: white;
}

.help-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.help-content ol, .help-content ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.help-content li {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.help-content a {
    color: #667eea;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.help-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.help-content strong {
    color: #333;
}

.translation-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section, .output-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.language-selector select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.language-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.arrow {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
}

.input-methods {
    margin-bottom: 20px;
}

.text-input textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.voice-input {
    margin-top: 15px;
    text-align: center;
}

.voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.voice-btn:hover:not(:disabled) {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.voice-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.voice-btn.recording {
    background: #ff4757;
    animation: pulse 1.5s infinite;
}

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

.mic-icon {
    font-size: 1.2rem;
}

.voice-status {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    min-height: 20px;
}

.translate-btn {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.translate-btn:hover:not(:disabled) {
    background: #5a6fd8;
}

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

.output-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.translation-result {
    margin-bottom: 25px;
}

.output-text {
    min-height: 120px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.emotion-analysis {
    border-top: 1px solid #e1e5e9;
    padding-top: 20px;
}

.emotion-result {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emotion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.emotion-label {
    font-weight: 600;
    color: #555;
}

.emotion-value {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.emotion-value.positive {
    background: #d4edda;
    color: #155724;
}

.emotion-value.negative {
    background: #f8d7da;
    color: #721c24;
}

.emotion-value.neutral {
    background: #e2e3e5;
    color: #383d41;
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .translation-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input {
        min-width: auto;
    }
    
    .language-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .emotion-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .input-section, .output-section {
        padding: 20px;
    }
    
    .voice-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}
