/* public/css/style.css */

/* Import Google Fonts (optionnel) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    --gmdtv-green: #4CAF50;
    --gmdtv-light-green-bg: rgba(76, 175, 80, 0.05);
    --gmdtv-hover-green-bg: rgba(76, 175, 80, 0.15);
    --gmdtv-shadow-green: rgba(76, 175, 80, 0.4);
    --gmdtv-orange-accent: #FF9800;
    /* ou #FFA500, #FD7E14 */
}

body {
    background-color: #333;
    /* Fond général extérieur */
    color: #f8f9fa;
    /* Couleur de texte par défaut (clair) */
    font-family: 'Roboto', 'Arial', sans-serif;
    /* Police */
    padding-top: 15px;
    padding-bottom: 15px;
    margin: 0;
    /* Assurer qu'il n'y a pas de marge par défaut */
}

/* --- Conteneur Principal Format Téléphone --- */
.main-container {
    max-width: 420px;
    /* LARGEUR FIXE MAXIMALE - C'est la clé ! */
    min-height: calc(100vh - 30px);
    /* Hauteur minimale pour remplir l'écran */
    margin: 0 auto;
    /* Centrage horizontal */
    background-color: #1e1e1e;
    /* Fond intérieur de l'app (un peu plus clair que le body) */
    border-radius: 15px;
    /* Coins arrondis plus marqués */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    /* Ombre portée */
    overflow: hidden;
    /* Empêche le contenu de déborder visuellement */
    display: flex;
    flex-direction: column;
    /* Organise header, main, footer verticalement */
}

.main-container .container,
.main-container .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* --- Layout Header / Main / Footer --- */
.app-header {
    background-color: #252525;
    /* Fond de l'en-tête */
    border-bottom: 1px solid #444;
    /* Ligne de séparation */
    flex-shrink: 0;
    /* Empêche le header de rétrécir */
    padding: 0.75rem 1rem;
    /* Un peu de padding */
}

.app-header h5 {
    /* Pour le conteneur du logo */
    margin-bottom: 0;
    /* Enlever la marge par défaut de h5 */
}

.app-header h5 img {
    vertical-align: middle;
    /* Aligner le logo avec le texte */
    height: 30px;
    /* Hauteur du logo comme dans le header.php */
    margin-right: 10px;
    /* Marge à droite du logo comme dans le header.php */
}

.app-header .btn-danger {
    /* Style pour le bouton déconnexion */
    background-color: #dc3545;
    border-color: #dc3545;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.app-header .btn-danger i {
    /* Icône dans le bouton déconnexion */
    font-size: 0.9rem;
    /* Ajuster la taille de l'icône Bootstrap */
}


.app-main {
    flex-grow: 1;
    /* Prend tout l'espace vertical disponible */
    padding: 20px 15px;
    /* Espace intérieur pour le contenu */
    overflow-y: auto;
    /* Active le scroll vertical SI le contenu dépasse */
}

.app-footer {
    background-color: #252525;
    /* Fond du pied de page */
    border-top: 1px solid #444;
    /* Ligne de séparation */
    font-size: 0.8em;
    flex-shrink: 0;
    /* Empêche le footer de rétrécir */
    padding: 0.75rem 1rem;
    /* Un peu de padding */
    text-align: center;
    /* Centrer le texte du footer */
}

.app-footer p {
    margin-bottom: 0;
    color: #aaa;
}

/* --- Styles Communs --- */
a {
    color: var(--gmdtv-green);
    text-decoration: none;
}

a:hover {
    color: #66bb6a;
    text-decoration: none;
    /* Pas de soulignement au survol pour un look plus propre */
}

/* Formulaires (login, signup, etc.) */
.form-container {
    /* Conteneur des formulaires d'authentification */
    padding: 15px;
    /* Un peu de padding interne */
}

.form-container img.img-fluid {
    /* Logo GMDTV sur les pages auth */
    display: block;
    margin: 0 auto 1rem auto;
    /* Centrer et espacer */
}


.form-control,
.form-select {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.form-control:focus,
.form-select:focus {
    background-color: #444;
    color: #fff;
    border-color: var(--gmdtv-green);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
    /* Ombre focus verte */
}

.form-label {
    color: #ccc;
}

.form-control::placeholder {
    color: #aaa;
    opacity: 1;
}

/* Style pour Select2 */
.select2-container--bootstrap-5 .select2-selection--single {
    background-color: #333 !important;
    border: 1px solid #555 !important;
    color: #fff !important;
    height: calc(1.5em + .75rem + 2px) !important;
    padding: .375rem .75rem !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #ccc transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: #333 !important;
    border: 1px solid #555 !important;
}

.select2-results__option {
    color: #fff !important;
}

.select2-results__option--highlighted {
    background-color: var(--gmdtv-green) !important;
    color: #fff !important;
}

.select2-search__field {
    background-color: #444 !important;
    color: #fff !important;
    border: 1px solid #555 !important;
}

/* --- Styles pour les Items de Service (avec images rondes) --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 colonnes par défaut */
    gap: 15px;
    /* Espace entre les items */
    text-align: center;
}

.service-item {
    /* Chaque cellule de la grille */
    /* Pas de style direct ici, le lien <a> prendra tout l'espace */
}

.service-item a {
    /* Le lien qui englobe l'image et le texte */
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #1a1a1a; /* Boîte de fond sombre */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    color: #ccc;
    /* Couleur du texte sous l'icône */
    padding: 12px 5px;
    border-radius: 12px;
    height: 100%; /* Prend toute la hauteur disponible dans la grille */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.service-item a:hover {
    background-color: #252525;
    /* Léger fond au survol de l'item complet */
    transform: translateY(-5px);
    /* Léger déplacement vers le haut */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    color: #fff;
}

.service-item .service-icon-image-wrapper {
    display: flex;
    /* Pour centrer l'image à l'intérieur */
    align-items: center;
    justify-content: center;
    width: 75px;
    /* Largeur fixe du cercle */
    height: 75px;
    /* Hauteur fixe du cercle */
    margin: 0 auto 8px auto;
    /* Centrage horizontal et marge en bas */
    /* padding: 0; Supprimé pour que l'image remplisse le cercle */
    border: 2.5px solid var(--gmdtv-green);
    border-radius: 50%;
    /* Rend le conteneur rond */
    background-color: var(--gmdtv-light-green-bg);
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-sizing: border-box;
    overflow: hidden;
    /* Très important pour que l'image à l'intérieur soit coupée en cercle */
}

.service-item .service-icon-img-content {
    /* L'image elle-même */
    width: 100%;
    /* L'image prendra toute la largeur du wrapper */
    height: 100%;
    /* L'image prendra toute la hauteur du wrapper */
    object-fit: cover;
    /* Assure que l'image remplit l'espace en conservant son ratio et sera coupée si nécessaire */
    /* border-radius: 50%; Optionnel, car overflow:hidden sur le parent devrait suffire */
}

.service-item a:hover .service-icon-image-wrapper {
    transform: scale(1.08);
    background-color: var(--gmdtv-hover-green-bg);
    box-shadow: 0 0 15px var(--gmdtv-shadow-green);
}

.service-item p {
    font-size: 0.75rem;
    /* Un peu plus petit pour ne pas surcharger */
    font-weight: bold;
    margin-bottom: 0;
    color: #ccc;
    margin-top: 4px;
    /* Espace entre image et texte */
    transition: color 0.2s ease-in-out;
    line-height: 1.2;
    /* Améliorer la lisibilité du petit texte */
    word-break: break-word;
    /* Pour les noms de service un peu longs */
}

.service-item a:hover p {
    color: #fff;
    /* Rendre le texte blanc au survol */
}

/* Grille de service à 2 colonnes pour certains cas (si besoin) */
/* Ajoutez la classe "two-columns" au div.service-grid dans le PHP si nécessaire */
.service-grid.two-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    /* Peut-être un peu plus d'espace si moins de colonnes */
}

.service-grid.two-columns .service-item .service-icon-image-wrapper {
    width: 85px;
    /* Un peu plus grand pour 2 colonnes */
    height: 85px;
}


/* Style pour le contenu de TOUTES les modales Bootstrap */
.modal-content {
    background-color: #2a2a2a !important;
    color: #f8f9fa !important;
    border: 1px solid #555;
}

.modal-body {
    color: inherit;
}

.modal-body .description {
    color: #ccc;
}

.modal-body .price {
    color: #ffffff;
}

.modal-body .price strong {
    color: var(--gmdtv-green);
}

.modal-header {
    border-bottom: 1px solid #444;
    color: #f8f9fa;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-footer {
    border-top: 1px solid #444;
}

.modal-title span {
    color: var(--gmdtv-orange-accent);
}

.modal-body .form-label {
    color: #ccc;
}

/* Boutons */
.btn {
    transition: background-color 0.2s ease-in-out,
        border-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        transform 0.1s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.btn-success:hover,
.btn-primary:hover {
    filter: brightness(115%);
}

.btn-outline-secondary:hover {
    color: #fff !important;
}

.btn:active {
    transform: scale(0.97);
    filter: brightness(95%);
}

/* Style pour le bouton Retour Professionnel (Vectoriel) */
.btn-back-custom {
    background-color: rgba(255, 255, 255, 0.05); /* Fond subtil */
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    flex-shrink: 0; /* Empêche le bouton de s'écraser */
}

.btn-back-custom i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.btn-back-custom:hover {
    background-color: var(--gmdtv-orange-accent);
    color: #fff;
    border-color: var(--gmdtv-orange-accent);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4); /* Ombre orangée */
}

.btn-back-custom:hover i {
    transform: translateX(-4px); /* Petit déplacement vers la gauche */
}


/* Titres des pages (comme "FILIÈRES SUPÉRIEURES") */
.page-title-custom {
    color: #f8f9fa;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem !important;
    font-size: 1.1rem;
    /* Taille de police pour les titres de section */
}

/* Pour l'image VOD sur service.php */
.vod-banner-link img {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    width: 100%;
    /* Assurer que l'image prend toute la largeur de son conteneur */
}

.vod-banner-link:hover img {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Message "Nos Services Éducatifs" */
.educational-services-title {
    color: #aaa;
    font-weight: normal;
    font-size: 1.0rem;
    /* Ajusté pour être un peu plus discret */
    margin-top: 1.5rem;
    /* Espace après la bannière VOD */
    margin-bottom: 1rem !important;
}

/* Responsive Layout */
@media (min-width: 576px) {
    /* Petits appareils en mode paysage ou petites tablettes */
    .main-container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    /* Tablettes */
    .main-container {
        max-width: 720px;
    }
    .service-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    /* Desktop */
    .main-container {
        max-width: 960px;
    }
    .service-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
}

/* Assurer que les images de logo/bannière ne dépassent pas leur conteneur */
img.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Scrollbar Customization (Pro Look) */
.app-main::-webkit-scrollbar {
    width: 6px;
}
.app-main::-webkit-scrollbar-track {
    background: transparent;
}
.app-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.app-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}