/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 2px 0;
    color: white;
    margin-bottom: 2px;
}

header h1 {
    font-size: 1.1rem;
    margin-bottom: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: .5rem;
    opacity: 0.9;
}

/* Main content area */
main {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

/* Controls section */
.controls {
    margin-bottom: 30px;
}

.language-selector {
    margin-bottom: 20px;
    text-align: center;
}

.language-selector label {
    font-weight: bold;
    margin-right: 10px;
    color: #555;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.language-selector select:focus {
    outline: none;
    border-color: #2196F3;
}

.model-status {
    text-align: center;
    margin: 2px 0;
    padding: 1px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.model-status.loaded {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

#model-status {
    font-weight: bold;
    color: #666;
}

/* ACTION BUTTONS - SAME LINE FIX */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 10px 0;
    flex-direction: row; /* Force horizontal */
    flex-wrap: nowrap; /* Prevent wrapping */
}

.btn {
    padding: 15px 35px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent shrinking */
    min-width: 140px; /* Same width for both */
    white-space: nowrap; /* Prevent text wrapping */
}

.btn-success {
    background: linear-gradient(45deg, #4caf50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-success:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.btn-danger {
    background: linear-gradient(45deg, #f44336, #da190b);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.btn-danger:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

.btn-danger.recording {
    animation: pulse 1.5s infinite;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Transcription area */
.transcription-area {
    margin-top: 30px;
}

.transcription-area h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.transcription-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    min-height: 150px;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    text-align: left;
    overflow-y: auto;
    max-height: 300px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.transcription-box::-webkit-scrollbar {
    width: 8px;
}

.transcription-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.transcription-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.transcription-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Status bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2196F3;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.status-bar.error {
    background: #f44336;
}

.status-bar.recording {
    background: #ff9800;
    animation: recording-pulse 1s infinite;
}

.status-bar.loading {
    background: #ff9800;
}


/* Add these styles at the bottom of the file */
#translateBtn {
    display: block;
    margin: 15px auto;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
}

#translateBtn:hover:not(:disabled) {
    background-color: #218838;
}

#translateBtn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#translationOutput {
    background: #f8f9fa;
    width: 100%;
    min-height: 150px;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 18px;
    line-height: 1.6;
    text-align: left;
    overflow-y: auto;
}

/* #translationOutput {
background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    min-height: 150px;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    text-align: left;
    overflow-y: auto;
    max-height: 300px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
} */




@keyframes recording-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Mobile responsive - KEEP BUTTONS SAME LINE */
@media (max-width: 600px) {
    #app {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 10px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .action-buttons {
        gap: 15px;
        flex-direction: row !important; /* Force horizontal on mobile */
    }
}

/* Small mobile screens */
@media (max-width: 400px) {
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .action-buttons {
        gap: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    main {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .transcription-box {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .model-status {
        background: #2d3748;
    }
    
    .model-status.loaded {
        background: #1a202c;
        border-left-color: #48bb78;
    }
    
    #model-status {
        color: #cbd5e0;
    }
}