/* Variables et styles généraux */
:root {
    --transition-speed: 0.3s;
    --quantum-primary: var(--bs-secondary);
    --quantum-accent: var(--bs-info);
    --hover-transform: scale(1.02) translateY(-5px);
    --card-shadow: 0 10px 30px rgba(var(--bs-info-rgb), 0.15);
}

/* Logo styles avec fallback */
.navbar-logo {
    height: 80px;
    width: auto;
    border-radius: 5px;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

/* Navigation styles optimisés */
.navbar {
    background-color: rgba(33, 37, 41, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    will-change: transform;
}

/* Styles du bouton menu */
.navbar-toggler {
    border: 2px solid var(--bs-secondary);
    padding: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mode clair */
[data-bs-theme="light"] .navbar-toggler {
    border-color: var(--bs-dark);
}

[data-bs-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hover effects */
.navbar-toggler:hover {
    transform: scale(1.05);
    border-color: var(--bs-info);
}

[data-bs-theme="light"] .navbar-toggler:hover {
    border-color: var(--bs-info);
    background-color: rgba(var(--bs-dark-rgb), 0.1);
}

/* Optimisation des icônes */
.tech-icons i {
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    margin: 0.5rem;
    transform-origin: center;
    will-change: transform, opacity;
}

.tech-icons i:hover {
    transform: scale(1.2) translateY(-5px);
    opacity: 1;
    color: var(--bs-info);
}

body {
    padding-top: 76px;
}

/* Animation de transition douce */
.nav-link, .btn {
    transition: all var(--transition-speed) ease;
}

/* Correction du menu déroulant */
.dropdown-menu {
    z-index: 1030;
    position: absolute;
    background: rgba(var(--bs-dark-rgb), 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.1);
    animation: dropdownFade var(--transition-speed) ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards avec animation */
.card {
    background: rgba(var(--bs-dark-rgb), 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.1);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    will-change: transform;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(var(--bs-info-rgb), 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.card:hover {
    transform: var(--hover-transform);
    box-shadow: var(--card-shadow);
}

.card:hover::before {
    transform: translateX(100%);
}

.card .card-body {
    transition: all var(--transition-speed) ease;
}

/* Thème sombre/clair */
[data-bs-theme="light"] {
    transition: all var(--transition-speed) ease;
}

[data-bs-theme="light"] .navbar {
    background-color: rgba(248, 249, 250, 0.95) !important;
}

[data-bs-theme="light"] .navbar .nav-link,
[data-bs-theme="light"] .navbar .navbar-brand,
[data-bs-theme="light"] .navbar .dropdown-toggle {
    color: #000 !important;
}

[data-bs-theme="light"] .navbar .nav-link:hover,
[data-bs-theme="light"] .navbar .navbar-brand:hover,
[data-bs-theme="light"] .navbar .dropdown-toggle:hover {
    color: #333 !important;
}

[data-bs-theme="light"] .dropdown-menu {
    background: rgba(248, 249, 250, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Amélioration de la visibilité des titres et textes en mode clair */
[data-bs-theme="light"] .text-center h2,
[data-bs-theme="light"] section h2 {
    color: #000 !important;
    font-weight: 600;
}

[data-bs-theme="light"] .lead {
    color: #000 !important;
    font-weight: 400;
}

[data-bs-theme="light"] .display-4 {
    color: #000 !important;
    font-weight: 700;
}

[data-bs-theme="light"] section p {
    color: #000 !important;
}

/* Styles des cartes en mode clair */
[data-bs-theme="light"] .card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
}

[data-bs-theme="light"] .card .card-title {
    color: #000 !important;
    font-weight: 600;
}

[data-bs-theme="light"] .card .card-text {
    color: #333 !important;
}

[data-bs-theme="light"] .card h2,
[data-bs-theme="light"] .card h3,
[data-bs-theme="light"] .card p,
[data-bs-theme="light"] .card label {
    color: #000000 !important;
}

/* Icônes des technologies avec animation */
.tech-icons i {
    transition: all var(--transition-speed) ease;
    opacity: 0.8;
    margin: 0.5rem;
    transform-origin: center;
    cursor: pointer;
    position: relative;
    will-change: transform, opacity;
}

.tech-icons i:hover {
    transform: scale(1.2) translateY(-5px);
    opacity: 1;
    color: var(--bs-info);
    animation: iconPulse 1s ease infinite;
}

/* Effet au survol pour indiquer que l'icône est cliquable */
.tech-icons i::after {
    content: 'Cliquez pour plus d\'infos';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: rgba(var(--bs-info-rgb), 0.9);
    color: var(--bs-dark);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: sans-serif;
    font-weight: 500;
    z-index: 10;
}

.tech-icons i:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    bottom: -25px;
}

.clickable-icon {
    position: relative;
}

@keyframes iconPulse {
    0% { transform: scale(1.2) translateY(-5px); }
    50% { transform: scale(1.3) translateY(-7px); }
    100% { transform: scale(1.2) translateY(-5px); }
}

/* Styles pour la modale de description des technologies */
.tool-description-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1070;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tool-description-content {
    background: var(--bs-dark);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: left;
    border: 1px solid var(--bs-info);
    box-shadow: 0 0 20px rgba(var(--bs-info-rgb), 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.tool-description-content h4 {
    color: var(--bs-info);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(var(--bs-info-rgb), 0.3);
}

.tech-detail-item h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-left: 3px solid var(--bs-info);
    padding-left: 10px;
}

.tech-detail-item .description-text,
.tech-detail-item .usage-list,
.tech-detail-item .avantages-list {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    white-space: pre-line;
    font-size: 0.95rem;
}

/* Badges pour les niveaux d'expertise */
.expertise-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
}

.expert-level {
    background-color: #28a745; /* Vert */
}

.avancé-level {
    background-color: #17a2b8; /* Bleu */
}

.intermédiaire-level {
    background-color: #ffc107; /* Jaune */
    color: #212529;
}

.débutant-level {
    background-color: #6c757d; /* Gris */
}

/* Mode clair pour la modale */
[data-bs-theme="light"] .tool-description-modal {
    background: rgba(255, 255, 255, 0.8);
}

[data-bs-theme="light"] .tool-description-content {
    background: var(--bs-light);
    border-color: var(--bs-info);
    color: var(--bs-dark);
}

[data-bs-theme="light"] .tool-description-content h4,
[data-bs-theme="light"] .tech-detail-item h6 {
    color: var(--bs-primary);
}

/* Responsive design pour la modale */
@media (max-width: 768px) {
    .tool-description-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .tech-icons i::after {
        display: none; /* Masquer l'indication sur mobile */
    }
}

/* Animation des sections */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Couleurs spécifiques pour les icônes */
.fa-html5 { color: #e34f26; }
.fa-css3-alt { color: #2965f1; }
.fa-js { color: #f7df1e; }
.fa-react { color: #61dafb; }
.fa-python { color: #3776ab; }
.fa-php { color: #777bb4; }
.fa-node-js { color: #339933; }
.fa-aws { color: #ff9900; }
.fa-git-alt { color: #f05032; }
.fa-docker { color: #2496ed; }

/* Style des formulaires */
.form-control {
    background: rgba(var(--bs-dark-rgb), 0.5);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
    transition: all var(--transition-speed) ease;
}

.form-control:focus {
    background: rgba(var(--bs-dark-rgb), 0.7);
    border-color: var(--bs-info);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-info-rgb), 0.25);
    transform: translateY(-2px);
}

/* Tech icons section */
.tech-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.quantum-illustration {
    display: none;
}

/* Added styles for form elements in light mode */
[data-bs-theme="light"] .form-select,
[data-bs-theme="light"] select.form-select {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

[data-bs-theme="light"] .form-select:focus {
    border-color: var(--bs-info);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-info-rgb), 0.25);
}

[data-bs-theme="light"] .form-check-input:checked {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

[data-bs-theme="light"] .form-check-input {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

[data-bs-theme="light"] .form-check-label {
    color: #000000;
}

[data-bs-theme="light"] select.form-select option {
    background-color: #ffffff;
    color: #000000;
}

/* Styles pour la bannière de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(var(--bs-dark-rgb), 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 1050;
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-settings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(var(--bs-dark-rgb), 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 8px;
    z-index: 1060;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.1);
}

.cookie-settings h3 {
    margin-bottom: 1.5rem;
}

/* Mode clair */
[data-bs-theme="light"] .cookie-banner,
[data-bs-theme="light"] .cookie-settings {
    background: rgba(248, 249, 250, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .cookie-banner *,
[data-bs-theme="light"] .cookie-settings *,
[data-bs-theme="light"] .container h1,
[data-bs-theme="light"] .container h2,
[data-bs-theme="light"] .container p,
[data-bs-theme="light"] .form-check-label,
[data-bs-theme="light"] .form-label {
    color: #000000;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        justify-content: center;
    }
    .tech-icons i {
        font-size: 1.5rem;
        margin: 0.25rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding-top: 66px;
    }

    header {
        min-height: 60vh;
        text-align: center;
    }

    .hero-logo {
        max-width: 150px;
        margin: 2rem auto;
    }

    .navbar-logo {
        height: 30px;
    }
}

/* Styles pour la section hero */
header {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(45deg, var(--bs-dark) 0%, var(--bs-black) 100%);
    position: relative;
    overflow: hidden;
}

/* Container des particules */
.particles-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: transparent;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    animation: fadeInParticles 1.5s ease-out;
}

/* Animation d'apparition */
@keyframes fadeInParticles {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styles pour le logo dans la section hero */
.hero-logo {
    max-width: 200px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Cette section a été remplacée par une version améliorée plus haut dans le CSS */

/* Styles pour les pages de services */
.service-header {
    background: linear-gradient(45deg, var(--bs-dark) 0%, var(--bs-black) 100%);
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
}

.service-content .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-content .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(var(--bs-info-rgb), 0.15);
}

/* Style pour les cartes de service cliquables */
a.text-decoration-none .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

a.text-decoration-none .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(var(--bs-info-rgb), 0.15);
}

/* Assurez-vous que le texte reste lisible en mode clair */
[data-bs-theme="light"] a.text-decoration-none {
    color: inherit;
}

[data-bs-theme="light"] a.text-decoration-none:hover {
    color: inherit;
}

/* Optimisation mobile */
@media (max-width: 768px) {
    /* Ajustements généraux */
    body {
        padding-top: 66px;
    }

    /* Optimisation du formulaire de contact */
    #contact-form {
        padding: 1rem;
    }

    #contact-form .form-control {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    #contact-form .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
    }

    /* Amélioration de la lisibilité */
    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    /* Optimisation des cartes */
    .card {
        margin-bottom: 1rem;
    }

    .card:hover {
        transform: none; /* Désactive l'animation de survol sur mobile */
    }

    /* Ajustement des marges et du padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .col-md-4, .col-md-6, .col-md-8, .col-md-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Optimisation des alertes */
    .alert {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }

    /* Amélioration de la navigation */
    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-logo {
        height: 30px;
    }

    .navbar-toggler {
        padding: 0.4rem;
    }

    /* Optimisation des icônes */
    .tech-icons i {
        font-size: 1.5rem;
        margin: 0.25rem;
    }

    /* Ajustement des sections */
    section {
        padding: 2rem 0;
    }

    /* Optimisation du footer */
    footer {
        text-align: center;
    }

    footer .text-end {
        text-align: center !important;
        margin-top: 1rem;
    }
}

/* Optimisation pour très petits écrans */
@media (max-width: 375px) {
    .display-4 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-logo {
        height: 25px;
    }
}

/* Optimisation du rendu des polices */
@font-face {
    font-display: swap;
}

/* Optimisation du chargement des ressources */
.lazy-load {
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Optimisation des performances d'animation */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}