/* Variables CSS pour les couleurs */
:root {
    --primary-color: #007BFF;       /* Bleu Principal */
    --secondary-color: #28A745;     /* Vert (pour certains accents ou boutons) */
    --accent-color: #0056B3;        /* Bleu plus foncé pour les interactions */
    --text-dark: #343A40;           /* Gris foncé pour le texte principal */
    --text-light: #F8F9FA;          /* Gris très clair pour fonds clairs */
    --bg-light: #FFFFFF;            /* Blanc pour les fonds de section */
    --bg-dark: #212529;             /* Gris très foncé pour certains fonds sombres */
}

/* Base Reset & Typographie */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.25em; }

p {
    margin-bottom: 1em;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

/* Boutons Génériques */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 600;
    margin: 5px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #218838; /* Une teinte plus foncée de secondary */
    border-color: #218838;
}

.btn-tertiary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-tertiary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* En-tête (Header) */
.main-header {
    background-color: var(--bg-light);
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8em;
    margin: 0;
}

.logo a {
    color: var(--text-dark);
    font-weight: 700;
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 25px;
}

.main-nav ul li a {
    color: var(--text-dark);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
}

/* Barre de navigation responsive (cachée par défaut) */
.menu-toggle {
    display: none; /* Masqué sur les grands écrans */
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-dark);
}

/* Section Héro */
.hero {
    background-color: var(--bg-dark); /* Fond sombre pour le contraste */
    color: var(--text-light);
    padding: 100px 0;
    text-align: center;
}

.hero h2 {
    color: var(--text-light);
    font-size: 3.5em;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
}

.hero .btn {
    font-size: 1.1em;
    padding: 12px 25px;
}

/* Sections générales */
section {
    padding: 80px 0;
    background-color: var(--bg-light);
}

section:nth-of-type(odd) { /* Alternance de couleurs de fond */
    background-color: #f4f7fa; /* Un gris très léger */
}

section h3 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    position: relative;
    padding-bottom: 10px;
}

section h3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Section Spécialités */
.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
}

.specialty-item {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.specialty-item:hover {
    transform: translateY(-5px);
}

.specialty-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.specialty-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Section Portfolio Preview */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.portfolio-item {
    background-color: var(--bg-light);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.portfolio-item h4 {
    padding: 15px;
    margin-bottom: 0;
    color: var(--text-dark);
}

.portfolio-item p {
    padding: 0 15px 15px;
    font-size: 0.95em;
    color: #666;
}

.portfolio-item .btn-tertiary {
    display: block;
    width: calc(100% - 30px); /* Ajuste pour le padding */
    margin: 0 15px 15px;
}

/* Section CTA (Call to Action) en bas */
.cta-bottom {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 80px 0;
}

.cta-bottom h2 {
    color: var(--text-light);
    font-size: 3em;
    margin-bottom: 20px;
}

.cta-bottom p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
}

/* Pied de page (Footer) */
.main-footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-footer p {
    margin-bottom: 15px;
    opacity: 0.8;
}

.social-links a {
    margin: 0 10px;
    display: inline-block;
}

.social-links img {
    width: 24px;
    height: 24px;
    filter: invert(1); /* Rend les icônes blanches pour le fond sombre */
    transition: transform 0.3s ease;
}

.social-links img:hover {
    transform: translateY(-3px);
}


/* --- Styles spécifiques pour les nouvelles pages PHP et les formulaires --- */

/* Styles spécifiques pour les nouvelles pages PHP */
.page-hero {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 80px 0 60px;
    text-align: center;
    box-shadow: inset 0 -5px 15px rgba(0,0,0,0.1);
}

.page-hero h2 {
    color: var(--text-light);
    font-size: 3em;
    margin-bottom: 15px;
}

.page-hero p {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.content-section {
    padding: 60px 0;
}

/* Styles pour la page À Propos */
.about-me-content {
    display: flex;
    flex-wrap: wrap; /* Pour le responsive */
    align-items: flex-start;
    gap: 40px;
}

.about-image {
    flex: 0 0 300px; /* Largeur fixe pour l'image */
    max-width: 100%;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.about-text {
    flex: 1; /* Prend le reste de l'espace */
}

.about-text h3 {
    text-align: left; /* Réinitialise le centrage */
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 5px;
}
.about-text h3::after {
    left: 0; /* Aligne le soulignement à gauche */
    transform: translateX(0);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skills-grid span {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.skills-grid span:hover {
    background-color: var(--accent-color);
}

/* Styles pour les conteneurs de formulaire */
.contact-form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-top: 40px; /* Ajout d'une marge supérieure pour les sections */
    margin-bottom: 40px; /* Ajout d'une marge inférieure */
}

/* Styles pour les groupes de champs dans les formulaires */
.form-group {
    margin-bottom: 25px; /* Augmenter l'espace entre les champs */
}

/* Styles pour les labels */
.form-group label {
    display: block;
    margin-bottom: 10px; /* Plus d'espace entre le label et le champ */
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.05em; /* Légèrement plus grand pour la lisibilité */
}

/* Styles pour les champs de texte, email, textarea, et select */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea,
.contact-form select,
.ticket-form input[type="text"], /* Ajout spécifique pour le formulaire de ticket */
.ticket-form input[type="email"],
.ticket-form textarea,
.ticket-form select {
    width: 100%;
    padding: 14px; /* Augmenter le padding pour un look plus moderne */
    border: 1px solid #ddd;
    border-radius: 6px; /* Arrondi légèrement plus prononcé */
    font-size: 1em;
    color: var(--text-dark);
    background-color: #fefefe; /* Fond légèrement différent pour les champs */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Style au focus des champs */
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus,
.contact-form select:focus,
.ticket-form input[type="text"]:focus,
.ticket-form input[type="email"]:focus,
.ticket-form textarea:focus,
.ticket-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2); /* Ombre plus douce */
}

/* Styles spécifiques pour les boutons de soumission dans les formulaires */
.contact-form button.btn-primary,
.ticket-form button.btn-primary {
    width: auto; /* Permet au bouton de ne pas prendre toute la largeur s'il n'est pas responsive */
    display: block; /* Pour le centrage ou l'alignement */
    margin-top: 30px;
    font-size: 1.1em;
    padding: 14px 35px; /* Plus de padding pour un bouton plus grand */
    cursor: pointer;
    border-radius: 8px; /* Arrondi plus prononcé */
    margin-left: auto; /* Centre le bouton si display: block */
    margin-right: auto;
}

/* Style pour le texte de lien sous le formulaire de contact */
.contact-form-container p.text-center {
    font-size: 1.1em;
    margin-bottom: 30px; /* Plus d'espace au-dessus du formulaire */
    color: #555;
}

.contact-form-container p.text-center a {
    font-weight: 600;
    text-decoration: underline;
}

/* Ajout pour le select du budget dans ticket.php */
#budget_estime {
    appearance: none; /* Supprime le style par défaut du navigateur */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.9L146.2%20205.1L5.4%2069.9c-1.3-1.3-3.9-1.3-5.2%200c-1.3%201.3-1.3%203.9%200%205.2l143%20138.8c1.3%201.3%203.9%201.3%205.2%200l143-138.8c1.3-1.3%201.3-3.9%200-5.2c-1.3-1.3-3.9-1.3-5.2%200z%22%2F%3E%3C%2Fsvg%3E'); /* Icône de flèche personnalisée */
    background-repeat: no-repeat;
    background-position: right 15px center; /* Positionne la flèche à droite */
    background-size: 12px;
    padding-right: 40px; /* Espace pour la flèche */
}

/* Styles pour les messages d'alerte (succès/erreur) */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Styles pour le détail de projet */
.project-details {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.project-main-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.project-details h3 {
    text-align: left;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 5px;
}
.project-details h3::after {
    left: 0;
    transform: translateX(0);
}

.project-details ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.project-details ul li {
    margin-bottom: 8px;
}

.project-links {
    text-align: center;
    margin-top: 40px;
}

/* --- Styles spécifiques pour l'interface d'administration --- */
body {
    background-color: #f4f7fa; /* Couleur de fond légèrement différente pour l'admin */
}
.admin-header {
    background-color: #343a40; /* Couleur foncée pour l'en-tête admin */
    color: #fff;
    padding: 15px 0;
    text-align: center;
}
.admin-header h1 {
    color: #fff;
    margin: 0;
    font-size: 2em;
}
.admin-header nav ul {
    padding: 0;
    margin: 10px 0 0;
    list-style: none;
    display: flex;
    justify-content: center;
}
.admin-header nav ul li {
    margin: 0 15px;
}
.admin-header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.admin-header nav ul li a:hover {
    opacity: 1;
}
.admin-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.admin-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}
.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.ticket-table th, .ticket-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.ticket-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}
.ticket-table tr:nth-child(even) {
    background-color: #f2f2f2;
}
.ticket-table tr:hover {
    background-color: #e9e9e9;
}
/* Couleurs de statut */
.ticket-table .status-ouvert { color: #007bff; font-weight: bold; }
.ticket-table .status-en-cours { color: #ffc107; font-weight: bold; }
.ticket-table .status-ferme { color: #28a745; font-weight: bold; }

.action-buttons {
    display: flex;
    gap: 5px;
}
.action-buttons .btn {
    padding: 6px 10px;
    font-size: 0.85em;
    margin: 0;
}
.logout-btn {
    display: inline-block;
    margin-top: 20px;
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.logout-btn:hover {
    background-color: #c82333;
}
.no-tickets {
    text-align: center;
    padding: 30px;
    font-style: italic;
    color: #666;
}


/* --- Responsive Design (Média Queries) --- */

/* Pour les tablettes et petits écrans d'ordinateur */
@media (max-width: 992px) {
    .main-header .container {
        flex-wrap: wrap; /* Permet aux éléments de passer à la ligne */
        justify-content: center;
    }

    .main-nav ul {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }

    .main-nav ul li {
        margin: 0 15px;
    }

    .hero h2 {
        font-size: 2.8em;
    }

    section h3 {
        font-size: 2em;
    }
}

/* Pour les mobiles */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        align-items: flex-start; /* Alignement à gauche pour mobile */
    }

    .logo {
        width: 100%;
        text-align: center; /* Centre le logo sur mobile */
        margin-bottom: 15px;
    }

    .main-nav {
        display: none; /* Cache la navigation par défaut sur mobile */
        width: 100%;
    }

    .main-nav.active { /* Afficher quand le bouton est cliqué */
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul li {
        margin: 10px 0;
    }

    .menu-toggle {
        display: block; /* Affiche le bouton hamburger sur mobile */
        position: absolute; /* Positionne le bouton hamburger */
        right: 20px;
        top: 20px;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero h2 {
        font-size: 2.2em;
    }

    .hero p {
        font-size: 1.1em;
    }

    section {
        padding: 60px 0;
    }

    section h3 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .specialties-grid, .portfolio-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    }

    .cta-bottom h2 {
        font-size: 2.2em;
    }

    .main-footer .social-links {
        margin-top: 15px;
    }

    /* Responsive adjustments for new sections */
    .page-hero h2 {
        font-size: 2.2em;
    }
    .about-me-content {
        flex-direction: column;
    }
    .about-image {
        flex: none;
        width: 100%;
        margin-bottom: 30px;
    }
    .about-image img {
        max-width: 250px; /* Taille max sur mobile */
    }
    .project-details {
        padding: 25px;
    }

    /* Responsive adjustments for forms */
    .contact-form-container {
        padding: 25px; /* Réduire le padding sur mobile */
        margin-left: 15px; /* S'assurer qu'il y a une marge latérale */
        margin-right: 15px;
    }
    .contact-form button.btn-primary,
    .ticket-form button.btn-primary {
        width: 100%; /* Le bouton prend toute la largeur sur mobile */
        padding: 15px; /* Plus de padding pour les boutons tactiles */
    }

    /* Responsive pour la table admin */
    .ticket-table, .ticket-table thead, .ticket-table tbody, .ticket-table th, .ticket-table td, .ticket-table tr {
        display: block;
    }
    .ticket-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .ticket-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .ticket-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    .ticket-table td:last-child {
        border-bottom: 0;
    }
    .ticket-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-color);
    }
    .action-buttons {
        justify-content: flex-end;
    }
}