/* ========================================
   STYLES POUR L'ANALYSEUR DE VISIBILITÉ IA
   VERSION COMPLÈTE
   ======================================== */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Formulaire d'accueil */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.2em;
}

.form-group {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

input[type=url] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type=url]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 1.1em;
    color: #555;
    text-align: center;
}

/* Page de résultats */
.resultats-ia {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.header h1 {
    margin-bottom: 10px;
    color: #333;
}

.header p {
    color: #666;
    font-size: 1.1em;
    margin: 5px 0;
}

/* Score global - préservé */
.score-global {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-global.excellent { 
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); 
}

.score-global.bon { 
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); 
}

.score-global.moyen { 
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); 
}

.score-global.faible { 
    background: linear-gradient(135deg, #f43b47 0%, #453a94 100%); 
    color: white; 
}

.score-global h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.appreciation {
    font-size: 1.3em;
    font-weight: 500;
    margin-bottom: 20px;
}

.barre-progression {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.barre-progression div {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 1s ease-out;
}

/* Critères - 2 colonnes */
.criteres {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.critere {
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

.critere:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.critere.bon { border-left: 5px solid #4CAF50; }
.critere.moyen { border-left: 5px solid #FFC107; }
.critere.faible { border-left: 5px solid #F44336; }

.critere h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.score {
    background: #f0f0f0;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

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

.detail {
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    transition: transform 0.2s;
}

.detail:hover {
    transform: translateX(5px);
}

.detail.succes { 
    background: #e8f5e8; 
    color: #2e7d32; 
    border-left: 3px solid #4CAF50; 
}

.detail.erreur { 
    background: #ffebee; 
    color: #c62828; 
    border-left: 3px solid #F44336; 
}

.detail.avertissement { 
    background: #fff3e0; 
    color: #ef6c00; 
    border-left: 3px solid #FF9800; 
}

.detail.info { 
    background: #e3f2fd; 
    color: #1565c0; 
    border-left: 3px solid #2196F3; 
}

/* Recommandations */
.recommandations-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ff9800;
}

.recommandations-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #ff9800;
    font-weight: bold;
}

.recommandation-item {
    padding: 5px 0 5px 25px;
    color: #666;
    font-size: 0.9em;
    position: relative;
    line-height: 1.5;
}

.recommandation-item:before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #ff9800;
    font-weight: bold;
}

.recommandation-item:hover {
    color: #333;
    transform: translateX(3px);
    transition: all 0.2s;
}

/* Footer et boutons */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #666;
}

.erreur {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.api-link {
    margin-top: 20px;
    text-align: center;
}

.api-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
}

.api-link a:hover {
    text-decoration: underline;
}

.btn-retour {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-retour:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Styles additionnels */
.form-group.focused input[type=url] {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-copy, .btn-export {
    display: inline-block;
    margin: 10px 5px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-copy:hover, .btn-export:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-copy.copied {
    background: #4CAF50;
}

.details.collapsed {
    display: none;
}

.toggle-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 0.9em;
    color: #667eea;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    color: #333;
}

.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.dark-mode-toggle:hover {
    background: #444;
    transform: scale(1.05);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0%); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0%); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.notification-error { background: #F44336; }
.notification-success { background: #4CAF50; }
.notification-info { background: #2196F3; }

/* Styles pour l'upload CSV et mots-clés */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #e3f2fd;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e3f2fd;
    border-color: #4CAF50;
}

.keywords-section {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid #667eea30;
}

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

.keywords-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.keywords-count {
    background: #667eea;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8em;
}

.keywords-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-chip {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #667eea;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.keyword-chip:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.keyword-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    margin: 0 5px 5px 0;
    border: 1px solid #667eea;
    transition: all 0.3s;
}

.keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.csv-preview {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9em;
}

.keyword-count {
    background: #667eea;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8em;
    margin-left: 5px;
}

@keyframes fileLoaded {
    from { background-color: #4CAF50; color: white; }
    to { background-color: transparent; }
}

.file-loaded {
    animation: fileLoaded 1s ease-out;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.keyword-cloud .keyword-item {
    background: white;
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid #667eea;
    color: #333;
    font-size: 0.95em;
    transition: all 0.3s;
}

.keyword-cloud .keyword-item:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.keyword-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-box .number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-box .label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Mode sombre */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .form-card,
body.dark-mode .resultats-ia {
    background: #1e1e2f;
    color: #fff;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #fff;
}

body.dark-mode .header p {
    color: #ccc;
}

body.dark-mode .header {
    border-bottom-color: #333;
}

body.dark-mode .score-global.excellent,
body.dark-mode .score-global.bon,
body.dark-mode .score-global.moyen,
body.dark-mode .score-global.faible {
    color: white;
}

body.dark-mode .score-global.faible {
    color: white;
}

body.dark-mode .critere {
    background: #2d2d44;
    border-color: #444;
}

body.dark-mode .critere h3 {
    color: #fff;
    border-bottom-color: #444;
}

body.dark-mode .score {
    background: #444;
    color: #fff;
}

body.dark-mode .detail.succes {
    background: #1a3b1a;
    color: #a5d6a5;
}

body.dark-mode .detail.erreur {
    background: #3b1a1a;
    color: #ef9a9a;
}

body.dark-mode .detail.avertissement {
    background: #3b2e1a;
    color: #ffcc80;
}

body.dark-mode .detail.info {
    background: #1a2b3b;
    color: #90caf9;
}

body.dark-mode .btn-retour {
    background: #333;
    color: #fff;
}

body.dark-mode .btn-retour:hover {
    background: #444;
}

body.dark-mode .feature-item {
    background: #2d2d44;
    color: #ccc;
}

body.dark-mode .keywords-section {
    background: #2d2d44;
    border-color: #444;
}

body.dark-mode .keywords-header h4 {
    color: #fff;
}

body.dark-mode .keyword-chip {
    background: #1e1e2f;
    color: #fff;
    border-color: #667eea;
}

body.dark-mode .keyword-chip:hover {
    background: #667eea;
    color: white;
}

body.dark-mode .stat-box {
    background: #1e1e2f;
    color: #fff;
}

body.dark-mode .stat-box .number {
    color: #84fab0;
}

body.dark-mode .footer {
    border-top-color: #333;
    color: #ccc;
}

body.dark-mode .api-link a {
    color: #84fab0;
}

body.dark-mode .recommandation-item {
    color: #ccc;
}

body.dark-mode .recommandation-item:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .form-group {
        flex-direction: column;
    }
    
    .form-card, .resultats-ia {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .score-global h2 {
        font-size: 1.5em;
    }
    
    .appreciation {
        font-size: 1.1em;
    }
    
    .criteres {
        grid-template-columns: 1fr;
    }
    
    .dark-mode-toggle {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .keywords-header {
        flex-direction: column;
        align-items: flex-start;
    }
}