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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    min-height: 100vh;
    padding: 20px;
}

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

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

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 500;
}

.service-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.service-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #22c55e;
}

.service-logo {
    font-size: 2em;
}

.service-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
}

.section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.result-title {
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

.result-voice-info {
    color: #22c55e;
    font-weight: 600;
    font-size: 1.05em;
}

.model-selector-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector-compact label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.model-selector-compact select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85em;
    background: white;
    cursor: pointer;
    min-width: 250px;
}

.model-selector-compact select:focus {
    outline: none;
    border-color: #22c55e;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.voice-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.voice-card.selected {
    border-color: #22c55e;
    background: linear-gradient(135deg, #22c55e15, #16a34a15);
}

.voice-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.voice-info {
    font-size: 0.8em;
    color: #666;
}

.voice-lang {
    display: inline-block;
    background: #22c55e;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    margin-top: 5px;
}

.filter-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.filter-input:focus {
    outline: none;
    border-color: #22c55e;
}

.model-selector-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.model-info {
    font-size: 0.75em;
    color: #888;
    margin-top: 3px;
    font-style: italic;
}

.selected-voice-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    font-size: 0.9em;
}

.selected-voice-info.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.selected-voice-info strong {
    color: #22c55e;
}

.btn-copy {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #22c55e;
    border-color: #22c55e;
    transform: scale(1.1);
}

.btn-copy:active {
    transform: scale(0.95);
}

.btn-copy.copied {
    background: #4caf50;
    border-color: #4caf50;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #22c55e;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

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

.text-input:focus {
    outline: none;
    border-color: #22c55e;
}

.char-count {
    text-align: right;
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

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

.audio-player {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
}

.audio-player.active {
    display: block;
}

.service-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95em;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    margin-bottom: 15px;
}

audio {
    width: 100%;
    margin-top: 8px;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    font-size: 0.9em;
}

.error-message.active {
    display: block;
}

.download-btn {
    padding: 8px 15px;
    font-size: 0.9em;
    margin-top: 10px;
    width: auto;
    flex: none;
}

.btn-template {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-template:hover:not(:disabled) {
    border-color: #22c55e;
    background: linear-gradient(135deg, #22c55e15, #16a34a15);
    transform: translateY(-1px);
}

.btn-template:active {
    transform: translateY(0);
}

.btn-template.active {
    border-color: #22c55e;
    background: linear-gradient(135deg, #22c55e25, #16a34a25);
    font-weight: 600;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #22c55e;
}

.language-filter-info {
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: none;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9em;
    color: #2e7d32;
}

.language-filter-info.active {
    display: flex;
}

.btn-clear-filter {
    background: #fff;
    border: 1px solid #2e7d32;
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    color: #2e7d32;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.btn-clear-filter:hover {
    background: #2e7d32;
    color: white;
}

.voice-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.label-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 500;
    white-space: nowrap;
}

.label-tag.primary-lang {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

.label-tag.gender {
    background: #fce7f3;
    color: #9f1239;
}

.label-tag.accent {
    background: #fef3c7;
    color: #92400e;
}

.label-tag.age {
    background: #e0e7ff;
    color: #3730a3;
}

.label-tag.use_case {
    background: #f3e8ff;
    color: #6b21a8;
}

.btn-copy-json {
    padding: 8px 15px;
    border: 2px solid #22c55e;
    border-radius: 8px;
    background: white;
    color: #22c55e;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-json:hover {
    background: #22c55e;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-copy-json:active {
    transform: translateY(0);
}

.btn-copy-json.copied {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

/* Voice Settings Styles */
.voice-settings-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.setting-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.setting-item:hover {
    border-color: #22c55e;
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.setting-label {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.setting-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #22c55e;
    min-width: 50px;
    text-align: right;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #e0e0e0 0%, #22c55e 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #22c55e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #22c55e;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.5);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.5);
}

.setting-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 10px;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin: 10px 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #22c55e;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Responsive pour tablette : 2 colonnes */
@media (max-width: 1200px) {
    .voice-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .model-selector-compact {
        width: 100%;
    }

    .model-selector-compact select {
        flex: 1;
        min-width: 0;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Voice settings en colonne sur mobile */
    .voice-settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Afficher le select en mobile, masquer les boutons */
    .language-selector-mobile {
        display: block !important;
    }
    
    .language-selector-desktop {
        display: none !important;
    }
    
    /* Masquer le bloc "Langue active" en mobile */
    .language-filter-info {
        display: none !important;
    }
    
    /* Masquer les d�tails des voix en mobile (garder seulement le nom) */
    .voice-info,
    .voice-labels {
        display: none !important;
    }
    
    /* R�duire le padding des cartes de voix en mobile */
    .voice-card {
        padding: 10px;
    }
}

/* Par d�faut (desktop) : afficher les boutons, masquer le select */
.language-selector-mobile {
    display: none;
}

.language-selector-desktop {
    display: flex;
}

.language-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #22c55e;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.language-select:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Logout Button */
.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    z-index: 1000;
}

.logout-btn:hover {
    background: white;
    color: #22c55e;
}

/* Login Page Styles */
body:has(.login-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.login-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.login-subtitle {
    font-size: 1em;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9em;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #22c55e;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.lock-icon {
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
}

/* Styles pour les éléments inline code et kbd */
kbd {
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
    white-space: nowrap;
}

code {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}