:root {
    /* Mode sombre (défaut) */
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #181818;
    --footer-bg: rgba(20, 20, 20, 0.7);
    --footer-text: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #bbb;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(255, 255, 255, 0.05);
    
    --primary-color: #ff00d4;
    --secondary-color: #00b3ff;
    --accent-color: #9d00ff;
    
    --glow-opacity: 0.6;
}

.light-mode {
    /* Mode clair */
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --footer-bg: rgba(211, 220, 230, 0.7);
    --footer-text: #333333;
    --text-primary: #333333;
    --text-secondary: #555555;
    --glass-bg: rgba(0, 0, 0, 0.08);
    --glass-border: rgba(0, 0, 0, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.08);
    
    --glow-opacity: 0.3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
}

section {
    transition: background-color 0.3s ease;
}

/* Common card styles and transitions */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    transition: all 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px 0 var(--glass-shadow);
}

/* Feature cards */
.feature-card {
    transition: all 0.3s;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 0 15px 0 rgba(255, 0, 212, 0.5);
    border-color: transparent;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    z-index: -1;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-bg {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: background 0.3s ease;
}

/* Garder le dégradé de couleurs même en mode clair */
.light-mode .gradient-bg {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.light-mode .gradient-bg i {
    color: white !important;
}

/* Navigation */
.navbar {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.3s ease;
    padding: 1.5rem 15%;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
}

.light-mode .navbar {
    background: rgba(255, 255, 255, 0.8);
}

.nav-links a {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white !important;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 0, 212, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    z-index: -1;
    transition: opacity 0.3s linear;
    opacity: 0;
}

.btn-primary:hover::before {
    opacity: 1;
}

/* Bulles colorées globales */
.site-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Style des bulles */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background-color: #9d00ff;
    top: 5%;
    left: 10%;
    opacity: 0.5;
    animation: float-orb 20s ease-in-out infinite;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background-color: #ff00d4;
    top: 40%;
    right: 8%;
    opacity: 0.5;
    animation: float-orb-alt 23s ease-in-out infinite;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background-color: #00b3ff;
    bottom: 5%;
    left: 20%;
    opacity: 0.5;
    animation: float-orb 17s ease-in-out infinite;
}

.orb-4 {
    width: 250px;
    height: 250px;
    background-color: #ff00d4;
    top: 20%;
    right: 25%;
    opacity: 0.3;
    animation: float-orb-alt 15s ease-in-out infinite;
}

@keyframes float-orb {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
    100% { transform: translate(0, 0); }
}

@keyframes float-orb-alt {
    0% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
    100% { transform: translate(0, 0); }
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 20px); }
    100% { transform: translate(0, 0); }
}

/* Toggle switch */
.mode-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 34px;
}

.mode-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .mode-toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .mode-toggle-slider:before {
    transform: translateX(26px);
}

/* Moon and Sun icons */
.mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sun-icon, .moon-icon {
    transition: opacity 0.3s ease;
}

.light-mode .sun-icon {
    display: inline-block;
}

.light-mode .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: inline-block;
}

/* Modal styles mis à jour */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
}

.modal-flex-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
}

@media (min-width: 768px) {
    .modal-flex-container {
        flex-direction: row;
    }
}

.modal-image-container {
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-description {
    flex: 0 0 300px;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    overflow-y: auto;
    max-height: 30vh;
}

@media (min-width: 768px) {
    .modal-description {
        max-height: 90vh;
        border-left: 1px solid var(--glass-border);
    }
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-desc {
    font-size: 1rem;
    line-height: 1.6;
}

.modal-desc h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1.2rem 0 0.5rem 0;
    color: var(--secondary-color);
}

.modal-desc ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem 0;
}

.modal-desc li {
    margin-bottom: 0.25rem;
}

.modal-desc p {
    margin-bottom: 0.75rem;
}

.modal-desc strong {
    color: var(--accent-color);
    font-weight: bold;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    z-index: 10;
}

/* Style spécifique pour le mode clair */
.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.8);
}

.light-mode .modal-description {
    background: rgba(255, 255, 255, 0.9);
}

.light-mode .close-modal {
    color: var(--text-primary);
}

/* Footer styles */
#site-footer {
    position: relative;
    overflow: hidden;
    background-color: var(--footer-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.3s ease;
    z-index: 5;
}

#site-footer p {
    color: var(--footer-text);
    transition: color 0.3s ease;
}

.footer-container {
    position: relative;
    z-index: 10;
}

.footer-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.light-mode .footer-glass {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Glow effects for footer */
.footer-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: var(--glow-opacity);
}

.footer-glow-1 {
    background: var(--primary-color);
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: 15%;
    animation: floatSlow 12s ease-in-out infinite;
}

.footer-glow-2 {
    background: var(--accent-color);
    width: 150px;
    height: 150px;
    top: -30px;
    right: 25%;
    animation: floatSlow 8s ease-in-out infinite;
}

.footer-glow-3 {
    background: var(--secondary-color);
    width: 180px;
    height: 180px;
    bottom: -40px;
    right: 10%;
    animation: floatSlow 10s ease-in-out infinite;
}

@keyframes floatSlow {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-10px, 10px); }
    100% { transform: translate(0, 0); }
}

/* Gallery item effects */
.gallery-item {
    overflow: hidden;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-12px);
    z-index: 10;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    z-index: -1;
    border-radius: 18px;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover::before {
    opacity: 1;
    box-shadow: 
        0 0 20px 3px rgba(255, 0, 212, 0.6),
        0 0 30px 5px rgba(157, 0, 255, 0.4),
        0 0 40px 7px rgba(0, 179, 255, 0.3);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(-45deg, var(--secondary-color), var(--primary-color), var(--accent-color));
    z-index: -2;
    border-radius: 17px;
    opacity: 0;
    filter: blur(15px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 0.7;
}

.gallery-item img {
    transition: all 0.5s;
    border-radius: 15px;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.demo-frame {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 15px;
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Add padding for content */
main {
    padding-top: 2rem;
}

.hero {
    margin-top: 0;
}

/* Styles pour garantir la visibilité en mode clair */
.light-mode .glass {
    color: var(--text-primary);
}

.light-mode section p, 
.light-mode section h1, 
.light-mode section h2, 
.light-mode section h3, 
.light-mode section li {
    color: var(--text-primary);
}

/* Nouveaux styles pour améliorer le contraste en mode clair */
.light-mode .glass {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.light-mode .feature-card,
.light-mode .gallery-item {
    border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Style spécifique pour le hover en mode clair */
.light-mode .feature-card:hover {
    box-shadow: 0 0 15px 0 rgba(255, 0, 212, 0.4);
}

.light-mode .glass:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.12);
}

/* Styles pour la carte avec effet de rotation 3D */
#role-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: rotateX(0deg) rotateY(0deg);
    transition: transform 0.2s ease-out !important;
    will-change: transform;
    position: relative;
    z-index: 10;
}

#role-card:hover {
    transform: none !important; /* Désactive l'effet hover par défaut */
    box-shadow: 0 12px 40px 0 rgba(157, 0, 255, 0.2), 0 0 15px rgba(255, 0, 212, 0.3);
}

#role-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.15) 0%, 
                rgba(255, 255, 255, 0) 50%, 
                rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    pointer-events: none;
}

#role-card:hover::after {
    opacity: 1;
}

.light-mode #role-card::after {
    background: linear-gradient(135deg, 
                rgba(0, 0, 0, 0.05) 0%, 
                rgba(0, 0, 0, 0) 50%, 
                rgba(0, 0, 0, 0) 100%);
}

.light-mode #role-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* Styles pour la bulle qui suit le curseur */
#follow-orb {
    position: fixed !important;
    pointer-events: none !important; /* Permet de cliquer à travers l'orb */
    z-index: 0 !important; /* Au-dessus du fond mais sous le contenu */
    transition: none !important; /* Désactive toute transition pour un suivi immédiat */
}

/* Styles pour la nouvelle section des prototypes */
.evolution-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: rotateX(0deg) rotateY(0deg);
    transition: transform 0.2s ease-out !important;
    will-change: transform;
    position: relative;
    z-index: 10;
}

.evolution-card:hover {
    transform: none !important; /* Désactive l'effet hover par défaut */
    box-shadow: 0 12px 40px 0 rgba(0, 179, 255, 0.2), 0 0 15px rgba(255, 0, 212, 0.3);
}

.evolution-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
                rgba(255, 255, 255, 0.15) 0%, 
                rgba(255, 255, 255, 0) 50%, 
                rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    pointer-events: none;
}

.evolution-card:hover::after {
    opacity: 1;
}

/* Style pour la carte récapitulative des prototypes */
.prototype-summary-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Style pour le modal des prototypes */
.prototype-modal {
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.9);
}

.modal-prototype-container {
    max-height: 75vh;
    overflow-y: auto;
}

/* Style pour les cartes de prototype dans le modal */
.prototype-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 400px; /* Hauteur fixe pour toutes les cartes */
    transition: all 0.4s;
    transform: translateY(20px);
    opacity: 0;
}

.prototype-card.animate-fadeIn {
    transform: translateY(0);
    opacity: 1;
}

.prototype-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px rgba(0, 179, 255, 0.4), 0 0 15px rgba(255, 0, 212, 0.3);
}

/* Partie description de la carte de prototype */
.prototype-card-description {
    flex-grow: 1; /* Prend tout l'espace disponible entre l'icône et le bouton */
}

.light-mode .prototype-modal {
    background: rgba(240, 240, 240, 0.95);
}

.light-mode .prototype-card:hover {
    box-shadow: 0 0 25px rgba(0, 179, 255, 0.4), 0 0 15px rgba(255, 0, 212, 0.3);
}

/* Responsive design for prototype modal */
@media (max-width: 768px) {
    .prototype-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-prototype-container {
        padding: 1rem;
    }
}

/* Ajustements supplémentaires pour le modal des prototypes */
.prototype-card .fa-external-link-alt {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.prototype-card:hover .fa-external-link-alt {
    opacity: 1;
    transform: translateX(3px);
}

.prototype-card a {
    transition: all 0.3s ease;
}

.prototype-card a:hover {
    box-shadow: 0 0 15px rgba(255, 0, 212, 0.7);
}



/* Ajustements d'accessibilité pour le mode clair */
.light-mode .prototype-summary-card {
    background-color: rgba(240, 240, 240, 0.9) !important;
}

.light-mode .prototype-summary-card i {
    color: var(--secondary-color) !important;
}

.light-mode .prototype-btn {
    color: white !important;
}

/* Améliorations pour les animations */
@keyframes glow {
    0% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 15px rgba(255, 0, 212, 0.3); }
    50% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(255, 0, 212, 0.5), 0 0 30px rgba(0, 179, 255, 0.3); }
    100% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 15px rgba(255, 0, 212, 0.3); }
}