* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

main {
    padding: 30px;
}

/* Subtítulos */
.subtitles-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.subtitle-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    min-height: 150px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.subtitle-box:hover {
    transform: translateY(-5px);
}

.subtitle-box.user {
    border-left: 5px solid #3b82f6;
}

.subtitle-box.ai {
    border-left: 5px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.translations-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.translation-box {
    background: #fef3c7;
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid #f59e0b;
}

.translation-box h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #92400e;
}

.translation-text {
    font-size: 1rem;
    color: #78350f;
    font-style: italic;
}

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

.subtitle-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #555;
    min-height: 80px;
}

/* Historial */
.conversation-history {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
}

.conversation-history h3 {
    margin-bottom: 15px;
    color: #333;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-item .timestamp {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.history-item .text {
    margin-bottom: 5px;
}

.history-item .english-text {
    color: #3b82f6;
    font-weight: 500;
}

.history-item .spanish-text {
    color: #ef4444;
    font-style: italic;
}

/* Controles */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

.btn-start {
    background: #10b981;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #059669;
    transform: scale(1.05);
}

.btn-stop {
    background: #ef4444;
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-clear {
    background: #6b7280;
    color: white;
}

.btn-clear:hover {
    background: #4b5563;
    transform: scale(1.05);
}

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

/* Estado */
.status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: #10b981;
}

.status-dot.listening {
    background: #ef4444;
    animation: pulse-fast 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-fast {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.language-info {
    color: #555;
    font-size: 0.95rem;
}

.voice-settings {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.voice-settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #555;
}

.voice-settings input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.voice-settings input[type="range"] {
    width: 100px;
    cursor: pointer;
}

#speedValue {
    font-weight: 600;
    color: #3b82f6;
    min-width: 40px;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .subtitles-container,
    .translations-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .status {
        flex-direction: column;
        text-align: center;
    }
}

/* Scrollbar personalizada */
.conversation-history::-webkit-scrollbar {
    width: 8px;
}

.conversation-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.conversation-history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.conversation-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}
