:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at 10% 20%, #1e1b4b 0%, #0f172a 100%);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --eco-color: #a6e3a1;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
}

/* Formes d'arrière-plan abstraites */
.bg-shape {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: float 10s infinite alternate ease-in-out;
}
.shape-1 {
    width: 300px; height: 300px;
    background: rgba(99, 102, 241, 0.3);
    top: 10%; left: 15%;
}
.shape-2 {
    width: 400px; height: 400px;
    background: rgba(192, 132, 252, 0.2);
    bottom: 10%; right: 10%;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-30px) scale(1.05); }
}

.app-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 2.5rem;
    width: 100%;
    max-width: 1200px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(30px);
    opacity: 0;
    animation: slideUp 0.8s 0.2s ease-out forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); opacity: 1; }
}

.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.header-icon {
    font-size: 3rem !important;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fenêtre de traduction */
.window {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.2);
}

.textarea-wrapper { position: relative; }

textarea, .output-box {
    width: 100%;
    min-height: 140px;
    height: auto;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(166, 227, 161, 0.2);
    border-radius: 12px;
    padding: 1rem;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    resize: none;
    outline: none;
    line-height: 1.6;
    box-sizing: border-box;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    overflow-y: auto;
}
textarea:focus, .output-box:focus {
    border-color: var(--eco-color);
    background: rgba(0, 0, 0, 0.6);
}
textarea::placeholder { color: rgba(148, 163, 184, 0.5); font-weight: 400; }

.btn-translate {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
    font-family: 'Outfit', sans-serif;
    width: 100%;
}
.btn-translate:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(79, 70, 229, 0.6);
    background: linear-gradient(135deg, #5b54fa, #8b5cf6);
}
.btn-translate:active { transform: translateY(1px) scale(0.98); }
.btn-translate .material-symbols-outlined {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}
.btn-translate:hover .material-symbols-outlined { transform: translateX(4px); }

.mic-btn {
    background: rgba(30, 41, 59, 0.8);
    color: var(--primary-light);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 80px; height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.mic-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}
.mic-btn.recording {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.rotating { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Warning banner */
.warning-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #ef4444;
    text-align: center;
    display: none;
}

/* ========== RESPONSIVE DESIGN (Smartphone) ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-container {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    h1 {
        font-size: 1.8rem;
    }

    .header-icon {
        font-size: 2.5rem !important;
    }

    .controls-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    #statusText {
        font-size: 1.2rem !important;
        margin-top: 1rem;
    }

    .lang-selector {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem !important;
    }

    .lang-selector label {
        font-size: 2rem !important;
    }

    textarea, .output-box {
        min-height: 200px;
        height: auto;
        font-size: 1.1rem;
    }
    
    #llm-info-container {
        flex-direction: column;
        text-align: center;
    }

    #logsAccordionContent {
        padding: 0 5px !important;
    }
    
    table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
