/**
 * Styles frontend pour la recherche ADSL
 */

/* Container principal */
.cad-search-container {
    max-width: 90rem;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* Formulaire de recherche */
.cad-search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .cad-search-form {
        flex-direction: row;
    }
}

.cad-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.cad-search-input:focus {
    outline: none;
    border-color: #E30613;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.cad-search-button {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background: #E30613;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cad-search-button:hover {
    background: #C00510;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Autocomplétion */
.cad-autocomplete {
    position: absolute;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    z-index: 9999 !important;
    width: 100%;
    max-width: 100%;
    pointer-events: auto !important;
    max-height: 400px;
    overflow-y: auto;
}

.cad-autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cad-autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer !important;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    user-select: none;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.cad-autocomplete-item:last-child {
    border-bottom: none;
}

.cad-autocomplete-item:hover {
    background: #f9fafb;
}

.cad-autocomplete-item .cad-dept {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Résultats */
.cad-results {
    margin-top: 2rem;
}

/* Statistiques */
.cad-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.cad-stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cad-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cad-stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #E30613;
    margin-bottom: 1rem;
}

.cad-stat-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.cad-stat-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.cad-communes-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.cad-commune-item {
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer !important;
    transition: all 0.2s ease;
    user-select: none;
}

.cad-commune-item:hover {
    background: #f9fafb;
    border-color: #E30613;
    transform: translateX(4px);
}

.cad-commune-item strong {
    color: #111827;
    font-size: 1.1rem;
}

.cad-commune-item .cad-dept {
    color: #6b7280;
    font-size: 0.9rem;
}

.cad-commune-details {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cad-commune-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f3f4f6;
}

.cad-commune-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: #1f2937;
}

.cad-commune-dept {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0;
}

/* Grille d'informations */
.cad-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cad-info-card {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.cad-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.cad-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cad-info-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #374151;
}

.cad-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.cad-card-desc {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* Cartes spécifiques */
.cad-card-commercial {
    border-left: 4px solid #DB0018;
}

.cad-card-technical {
    border-left: 4px solid #DB0018;
}

.cad-card-fiber {
    border-left: 4px solid #004c9a;
}

/* Barre de progression */
.cad-progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.cad-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #004c9a, #0066cc);
    transition: width 0.5s ease;
}

/* Section CTA */
.cad-cta-section {
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid #f3f4f6;
}

.cad-cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #DB0018, #DB0018);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cad-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.3);
    text-decoration: none;
    color: #fff;
}

/* Loading */
.cad-loading {
    text-align: center;
    padding: 3rem;
}

.cad-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f4f6;
    border-top-color: #E30613;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages */
.cad-no-results,
.cad-error {
    text-align: center;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    color: #6b7280;
}

.cad-error {
    background: #fef2f2;
    color: #dc2626;
}

/* Liste de communes */
.cad-communes-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.cad-commune-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cad-commune-item:hover {
    background: #004c9a;
    color: #fff;
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .cad-search-form {
        flex-direction: column;
    }
    
    .cad-info-grid {
        grid-template-columns: 1fr;
    }
    
    .cad-commune-header h2 {
        font-size: 1.5rem;
    }
}
