/* 
 * Styles unifiés clairs pour Fo-Tech
 * Version consolidée incluant tous les styles spécifiques aux pages
 */

/* --------------------------------------------------------
   RESET ET STYLES DE BASE
   -------------------------------------------------------- */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #2980b9;
}

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

/* --------------------------------------------------------
   EN-TÊTE ET NAVIGATION
   -------------------------------------------------------- */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #3498db;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #3498db;
}

/* --------------------------------------------------------
   CONTENU PRINCIPAL
   -------------------------------------------------------- */
.site-content {
    padding: 40px 0;
    min-height: calc(100vh - 180px); /* Garantit que le footer reste en bas */
}

/* --------------------------------------------------------
   PIED DE PAGE
   -------------------------------------------------------- */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    display: flex;
}

.footer-links li {
    margin-right: 20px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-copyright {
    text-align: center;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------
   FORMULAIRES ET CONTRÔLES
   -------------------------------------------------------- */
.form-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.form-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #ffffff;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-box {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* --------------------------------------------------------
   BOUTONS
   -------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

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

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

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

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

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Style pour le bouton Archiver */
.status-archive {
    background-color: #95a5a6;
}

.status-archive:hover {
    background-color: #7f8c8d;
}

/* --------------------------------------------------------
   CLASSES UTILITAIRES
   -------------------------------------------------------- */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* --------------------------------------------------------
   TABLEAU DE BORD ET CARTES (DASHBOARD)
   -------------------------------------------------------- */
.dashboard-welcome {
    margin-bottom: 30px;
}

.dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-card h3 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
}

.dashboard-card h3 i {
    margin-right: 10px;
    color: #3498db;
}

.dashboard-card .card-content {
    padding: 15px 0;
}

.dashboard-overview {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dashboard-overview h2 {
    margin: 0;
    color: white;
}

.card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Liens rapides */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-link-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s;
    text-decoration: none;
}

.quick-link-item:hover {
    background-color: #e9ecef;
}

.quick-link-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.quick-action {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.quick-action:hover {
    background-color: #2980b9;
}

/* --------------------------------------------------------
   INDICATEURS D'ÉTAT
   -------------------------------------------------------- */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-ok {
    background-color: #2ecc71;
}

.status-warning {
    background-color: #f39c12;
}

.status-error {
    background-color: #e74c3c;
}

.test-result {
    margin-bottom: 8px;
}

/* --------------------------------------------------------
   INFORMATIONS SERVEUR
   -------------------------------------------------------- */
.server-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.server-info-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.server-info-label {
    font-weight: bold;
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
}

.server-info-value {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --------------------------------------------------------
   TABLEAUX
   -------------------------------------------------------- */
.surveys-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.surveys-table th, 
.surveys-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}

.surveys-table th {
    background-color: #3498db;
    color: #ffffff;
    font-weight: 500;
}

.surveys-table tr:last-child td {
    border-bottom: none;
}

.surveys-table tr:hover {
    background-color: #f9f9f9;
}

.note-stars {
    color: #FFD700;
}

/* --------------------------------------------------------
   PAGINATION
   -------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination a {
    color: #3498db;
    float: left;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color .3s;
    border: 1px solid #ddd;
    margin: 0 4px;
    background-color: #ffffff;
}

.pagination a.active {
    background-color: #3498db;
    color: white;
    border: 1px solid #3498db;
}

.pagination a:hover:not(.active) {
    background-color: #f1f1f1;
}

/* --------------------------------------------------------
   ADMINISTRATION DES ENQUÊTES
   -------------------------------------------------------- */
.admin-dashboard {
    margin-bottom: 40px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3498db;
    margin: 10px 0;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Distribution des notes */
.rating-distribution {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.rating-label {
    width: 60px;
    text-align: right;
    padding-right: 10px;
}

.rating-progress {
    flex-grow: 1;
    height: 25px;
    background-color: #f1f1f1;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.rating-fill {
    height: 100%;
    background-color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #333;
    font-size: 0.9rem;
    font-weight: bold;
    transition: width 0.5s;
}

/* Filtres */
.filters {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

/* Conteneur des boutons de filtre - horizontal avec flex */
.filter-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

/* Style des boutons dans les filtres pour qu'ils aient exactement la même taille */
.filter-actions .btn {
    flex: 1;                   /* Les deux boutons prennent la même proportion */
    min-width: 120px;          /* Largeur minimale */
    height: 42px;              /* Hauteur fixe */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    text-align: center;
    box-sizing: border-box;
    margin: 0;                 /* Supprime toute marge qui pourrait causer des problèmes */
}

/* Forcer les boutons à avoir la même largeur */
.filter-actions .btn:first-child {
    flex-basis: 50%;           /* Premier bouton prend 50% */
}

.filter-actions .btn:last-child {
    flex-basis: 50%;           /* Deuxième bouton prend 50% */
}

/* Pour les grands écrans */
@media (min-width: 992px) {
    .filter-actions {
        min-width: 260px;     /* Largeur minimale du conteneur */
    }
}

/* Pour le responsive */
@media (max-width: 768px) {
    .filter-group {
        flex: 1 0 100%;       /* Prend toute la largeur sur mobile */
    }
    
    .filter-actions {
        width: 100%;
    }
}

/* --------------------------------------------------------
   BADGES ET ÉTIQUETTES
   -------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
    background-color: #95a5a6;
}

/* --------------------------------------------------------
   DÉTAIL D'ENQUÊTE
   -------------------------------------------------------- */
.survey-detail {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    color: #333;
}

.survey-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.survey-id {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.survey-note {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    display: flex;
    align-items: center;
}

.survey-note .stars {
    margin-left: 10px;
    color: #FFD700;
}

.survey-section {
    margin-bottom: 30px;
}

.survey-section h3 {
    color: #3498db;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.survey-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    margin-bottom: 15px;
}

.info-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.info-value a {
    color: #3498db;
}

.info-value a:hover {
    color: #2980b9;
}

.comment-container {
    margin-top: 20px;
}

.commentaire {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-style: italic;
    margin-top: 15px;
    color: #333;
}

.empty-comment {
    color: #95a5a6;
}

.actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

/* --------------------------------------------------------
   SYSTÈME DE NOTATION PAR ÉTOILES
   -------------------------------------------------------- */
.star-rating-container {
    margin-top: 15px;
    position: relative;
    display: flex;
    align-items: center;
}

.star-rating {
    display: inline-flex;
    position: relative;
}

.star-rating .stars {
    font-size: 30px;
    color: #ddd;
    display: flex;
    line-height: 1;
}

.star-rating .stars-selected {
    position: absolute;
    top: 0;
    left: 0;
    color: #FFD700;  /* Couleur or */
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    font-size: 30px;
    width: 0;
    transition: width 0.2s;
    pointer-events: none;
    line-height: 1;
}

.star-rating .star {
    position: relative;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.star-rating .stars-selected .star {
    overflow: visible; /* Assure que les étoiles sont entièrement visibles */
}

.star-click-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 10;
    cursor: pointer;
}

.star-left-half {
    left: 0;
}

.star-right-half {
    right: 0;
}

.star i {
    display: block;
    width: 100%;
}

.rating-selected {
    margin-left: 15px;
    font-weight: bold;
    color: #3498db;
    font-size: 1.1rem;
}

.recommendation-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.recommendation-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --------------------------------------------------------
   COMMUTATEUR DE THÈME
   -------------------------------------------------------- */
   .theme-toggle {
    background-color: transparent;
    border: none;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 12px;
    margin-left: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------
   MEDIA QUERIES POUR RESPONSIVE
   -------------------------------------------------------- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
    }
    
    .main-nav {
        margin-top: 15px;
    }
    
    .main-nav ul {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav li {
        margin: 5px 0;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links ul {
        justify-content: center;
        margin-top: 15px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .survey-header {
        flex-direction: column;
        text-align: center;
    }
    
    .survey-note {
        margin-top: 15px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
    }
}