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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-left: 4px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.stat-card.esc {
    border-left-color: #e74c3c;
}

.stat-card.ce {
    border-left-color: #f39c12;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.keyword-selector {
    margin-bottom: 2rem;
}

.keyword-selector select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.keyword-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.page-analysis {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.page-analysis.esc {
    border-left: 4px solid #e74c3c;
}

.page-analysis.ce {
    border-left: 4px solid #f39c12;
}

.semantic-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 100%;
}

.semantic-metric {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.semantic-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.semantic-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-tabs {
    display: flex;
    border-bottom: 2px solid #ecf0f1;
    margin: 1.5rem 0 1rem 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
}

.tab-button:hover {
    color: #2c3e50;
}

.tab-content {
    display: none;
    margin-top: 1rem;
}

.tab-content.active {
    display: block;
}

.keyword-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
}

.keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    font-size: 0.85rem;
}

.keyword-term {
    font-weight: 500;
    color: #2c3e50;
}

.keyword-density {
    color: #3498db;
    font-weight: bold;
    font-size: 0.8rem;
}

.ngram-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ngram-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ngram-term {
    font-weight: 500;
    color: #2c3e50;
    font-style: italic;
}

.ngram-count {
    background: #f8f9fa;
    color: #7f8c8d;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.semantic-indicators {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.indicator.positive {
    color: #27ae60;
}

.indicator.negative {
    color: #e74c3c;
}

.title-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.url-link {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    font-size: 0.8rem;
    overflow-wrap: break-word;
    max-width: 100%;
    display: block;
}

.url-link:hover {
    text-decoration: underline;
}

.performance-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.performance-metric {
    text-align: center;
}

.performance-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
}

.performance-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.keywords-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.keywords-table th,
.keywords-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.keywords-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.position-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.position-1 { background: #27ae60; }
.position-2 { background: #f39c12; }
.position-3 { background: #e67e22; }
.position-high { background: #e74c3c; }

.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #ecf0f1;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.metric-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Règles spécifiques pour la largeur des contenus longs */
.keyword-item, .ngram-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

.keyword-term, .ngram-term {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Amélioration des onglets pour petits espaces */
.tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Style pour les gaps sémantiques - augmente la hauteur automatiquement */
.semantic-gaps-container {
    min-height: 350px !important;
    height: auto !important;
}

.semantic-opportunities {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
}

/* Nouveau styles pour la Page 2 - Assistant IA */
.ai-assistant-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.ai-assistant-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ai-assistant-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.ai-validation-card {
    background: white;
    color: #333;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.validation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.validation-metric {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.validation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.strategy-result {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.strategy-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.strategy-section:last-child {
    border-bottom: none;
}

.strategy-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.generation-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .performance-indicators {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-analysis {
        padding: 1rem;
    }
    
    .semantic-metrics {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .validation-buttons {
        flex-direction: column;
    }
    
    .ai-assistant-header h1 {
        font-size: 1.5rem;
    }
}
