/* VocalCloud - Styles multilingues modernes */

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

:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --secondary: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --bg-hover: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
.app-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success);
}

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

.status-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.app-title {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Section de sélection de langues */
.language-section {
    margin-bottom: 30px;
}

.language-selector {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: end;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.lang-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-select:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.lang-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-swap {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    align-self: end;
}

.btn-swap:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

.btn-swap:active {
    transform: scale(0.95) rotate(180deg);
}

/* Section d'enregistrement */
.record-section {
    text-align: center;
    margin-bottom: 40px;
}

.btn-record {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--secondary), #F59E0B);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.btn-record:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(245, 158, 11, 0.4);
}

.btn-record:active {
    transform: scale(0.98);
}

.mic-icon {
    font-size: 48px;
}

.btn-label {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.record-hint {
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Overlay d'enregistrement */
.recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.recording-overlay.active {
    display: flex;
}

.recording-content {
    text-align: center;
}

.recording-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse-mic 1.5s infinite;
}

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

.recording-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.recording-animation {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
}

.wave {
    width: 4px;
    height: 30px;
    background: var(--secondary);
    border-radius: 2px;
    animation: wave-animation 1s infinite ease-in-out;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave-animation {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(2); }
}

.btn-stop {
    padding: 16px 40px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-stop:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Section de résultats */
.results-section {
    display: none;
    margin-bottom: 30px;
}

.results-section.visible {
    display: block;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.result-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 20px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detected-lang {
    margin-left: auto;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    min-height: 40px;
}

/* Lecteur audio */
.audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
}

.play-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 40px;
}

/* Section historique */
.history-section {
    margin-bottom: 30px;
}

.btn-clear-history {
    padding: 6px 12px;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear-history:hover {
    background: var(--danger);
    color: white;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-size: 14px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-text {
    font-size: 14px;
    color: var(--text-primary);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 30px 0;
    border-top: 2px solid var(--border);
    margin-top: 50px;
}

.app-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.version {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .app-container {
        padding: 15px;
    }

    .language-selector {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .btn-swap {
        width: 100%;
        height: 40px;
        margin: 10px 0;
    }

    .btn-record {
        width: 150px;
        height: 150px;
    }

    .mic-icon {
        font-size: 40px;
    }

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