:root {
    --bg-primary: #030712;
    --bg-secondary: #111827;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-light: rgba(255, 255, 255, 0.08);
    --accent-color: #6366f1;
    --accent2-color: #a855f7;
}

body.light-theme {
    --bg-primary: #f9fafb;
    --bg-secondary: #f3f4f6;
    --text-primary: #111827;
    --text-muted: #6b7280;
    --border-light: rgba(0, 0, 0, 0.08);
    --accent-color: #4f46e5;
    --accent2-color: #9333ea;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-theme {
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 0% 50%, rgba(147, 51, 234, 0.08) 0%, transparent 50%);
}

/* Cartes modernes */
.bento-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .bento-card {
    background: rgba(243, 244, 246, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.2);
}

body.light-theme .bento-card:hover {
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: 0 10px 40px -10px rgba(79, 70, 229, 0.15);
}

/* Bordures blanches pour la section About en mode sombre */
#about .bento-card {
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

#about .bento-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Bordures noires pour la section About en mode clair */
body.light-theme #about .bento-card {
    border: 1.5px solid rgba(0, 0, 0, 0.25);
}

body.light-theme #about .bento-card:hover {
    border-color: rgba(0, 0, 0, 0.4);
}

/* Animation de texte dégradé */
.text-gradient {
    background: linear-gradient(to right, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradientMove 5s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Navbar Unique Style */
.glass-nav {
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

body.light-theme .glass-nav {
    background: rgba(249, 250, 251, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(79, 70, 229, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1), 0 0 15px rgba(79, 70, 229, 0.05);
}

/* Liens de navigation avec effet laser */
.nav-link {
    position: relative;
    opacity: 0.7;
    transition: all 0.3s ease;
}
.nav-link:hover {
    opacity: 1;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #6366f1; /* Couleur Accent */
    box-shadow: 0 0 8px #6366f1;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}
.nav-link:hover::after {
    width: 20px; /* Largeur du trait laser */
}

/* Bouton Contact Shine Effect */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: all 0.6s;
}
.btn-shine:hover::before {
    left: 100%;
}

/* Scrollbar custom */
::-webkit-scrollbar { 
    width: 14px; 
}

::-webkit-scrollbar-track { 
    background: rgba(3, 7, 18, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb { 
    background: linear-gradient(to bottom, #6366f1, #a855f7, #ec4899);
    border-radius: 10px;
    border: 2px solid rgba(3, 7, 18, 0.5);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(to bottom, #818cf8, #c084fc, #f472b6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Modal Styles */
#cert-modal {
    transition: opacity 0.3s ease-in-out;
}
#cert-modal.hidden {
    opacity: 0;
    pointer-events: none;
}
#cert-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Modal dark theme - Add white borders */
#cert-modal .absolute.inset-0 {
    background: rgba(0, 0, 0, 0.8) !important;
}

#cert-modal > div:nth-child(2) {
    background: #111827 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
}

/* Modal light theme - White background with black borders */
html.light-theme #cert-modal .absolute.inset-0 {
    background: rgba(0, 0, 0, 0.5) !important;
}

html.light-theme #cert-modal > div:nth-child(2) {
    background: #ffffff !important;
    border: 1.5px solid rgba(0, 0, 0, 0.2) !important;
}

html.light-theme #cert-modal h3 {
    color: #000000 !important;
}

html.light-theme #cert-modal p {
    color: #666666 !important;
}

html.light-theme #cert-modal button {
    color: #999999 !important;
}

html.light-theme #cert-modal button:hover {
    color: #000000 !important;
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}
.theme-toggle svg {
    position: absolute;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.theme-toggle svg.icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}
.theme-toggle svg.icon-moon {
    opacity: 0;
    transform: rotate(-180deg);
}
body.light-theme .theme-toggle svg.icon-sun {
    opacity: 0;
    transform: rotate(180deg);
}
body.light-theme .theme-toggle svg.icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

body.light-theme .theme-toggle {
    background-color: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
}

body.light-theme .theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.25);
    border-color: rgba(0, 0, 0, 0.35);
}

/* Mobile Menu Panel Styles */
#mobile-menu-panel {
    animation: slideInMenu 0.3s ease-out;
}

#mobile-menu-panel.hidden {
    animation: slideOutMenu 0.3s ease-in;
    animation-fill-mode: forwards;
}

@keyframes slideInMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutMenu {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.mobile-menu-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: #6366f1 !important;
    font-weight: 600;
}

.mobile-menu-item.active span {
    color: #6366f1 !important;
}

.mobile-menu-item.active i {
    color: #6366f1 !important;
}

body.light-theme .mobile-menu-item.active {
    background-color: rgba(79, 70, 229, 0.12);
    color: #4f46e5 !important;
}

body.light-theme .mobile-menu-item.active span {
    color: #4f46e5 !important;
}

body.light-theme .mobile-menu-item.active i {
    color: #4f46e5 !important;
}

/* Active indicator in navbar */
#mobile-section-indicator {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), transparent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #6366f1;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: capitalize;
}

body.light-theme #mobile-section-indicator {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15), transparent);
    color: #4f46e5;
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    transition: width 0.3s ease;
}

.mobile-menu-item:hover::before {
    width: 100%;
}

/* Mobile theme toggle icon animations */
body.light-theme .theme-sun {
    display: none;
}

body.light-theme .theme-moon {
    display: block !important;
}

body.light-theme .theme-label {
    color: rgb(71, 85, 105) !important;
}

body.light-theme #mobile-menu-panel > div:nth-child(2) {
    background: linear-gradient(to bottom, #ffffff, #f9fafb) !important;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

body.light-theme #mobile-menu-panel {
    color: #000000 !important;
}

body.light-theme .mobile-menu-item {
    color: #000000 !important;
    background-color: transparent !important;
}

body.light-theme .mobile-menu-item * {
    color: #000000 !important;
}

body.light-theme .mobile-menu-item span {
    color: #000000 !important;
    font-weight: 500;
}

body.light-theme .mobile-menu-item:hover {
    background-color: rgba(79, 70, 229, 0.08) !important;
}

body.light-theme .mobile-menu-item i {
    color: #4f46e5 !important;
}

body.light-theme #mobile-theme-toggle {
    background-color: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.2);
    color: #000000 !important;
}

body.light-theme #mobile-theme-toggle:hover {
    background-color: rgba(79, 70, 229, 0.12);
    border-color: rgba(79, 70, 229, 0.3);
}

body.light-theme #mobile-theme-toggle span {
    color: #000000 !important;
}

body.light-theme #mobile-menu-panel .h-px {
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15), transparent) !important;
}

body.light-theme #mobile-menu-panel > div:nth-child(2) > div:nth-child(1) {
    background: linear-gradient(to right, #4f46e5, #9333ea, #4f46e5) !important;
}
body {
    color: var(--text-primary);
}

.text {
    color: var(--text-primary);
}

body.light-theme .text-white {
    color: var(--text-primary);
}

body.light-theme .text-muted {
    color: var(--text-muted);
}

body.light-theme .border-white {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4, body.light-theme h5, body.light-theme h6 {
    color: var(--text-primary);
}

body.light-theme a {
    color: var(--text-primary);
}

/* Scrollbar light theme */
html.light-theme ::-webkit-scrollbar { width: 14px; }
html.light-theme ::-webkit-scrollbar-track { 
    background: rgba(243, 244, 246, 0.8);
    border-radius: 10px;
}
html.light-theme ::-webkit-scrollbar-thumb { 
    background: linear-gradient(to bottom, #34d399, #10b981, #059669) !important;
    border-radius: 10px;
    border: 2px solid rgba(243, 244, 246, 0.8);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3), inset 0 0 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
html.light-theme ::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(to bottom, #6ee7b7, #34d399, #10b981) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), inset 0 0 8px rgba(0, 0, 0, 0.1);
}

/* Couleurs spécifiques pour le thème clair */
body.light-theme .text-gradient {
    background: linear-gradient(to right, #4f46e5, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .bg-accent {
    background-color: #4f46e5;
}

body.light-theme .text-accent {
    color: #4f46e5;
}

body.light-theme .border-accent {
    border-color: #4f46e5;
}

body.light-theme .bg-accent\/20 {
    background-color: rgba(79, 70, 229, 0.2);
}

body.light-theme .text-accent2 {
    color: #7c3aed;
}

body.light-theme .bg-accent2\/10 {
    background-color: rgba(147, 51, 234, 0.1);
}

body.light-theme .bg-accent2\/20 {
    background-color: rgba(147, 51, 234, 0.2);
}

body.light-theme .border-accent2 {
    border-color: #8b5cf6;
}

body.light-theme .hover\:bg-accent2\/20:hover {
    background-color: rgba(147, 51, 234, 0.2);
}

/* Better contrast for light theme nav links */
body.light-theme .nav-link {
    color: #374151;
    opacity: 0.8;
}

body.light-theme .nav-link:hover {
    color: #6366f1;
    opacity: 1;
}

body.light-theme .nav-link::after {
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* Better badge colors for light theme */
body.light-theme .bg-emerald-500\/10 {
    background-color: rgba(16, 185, 129, 0.15);
}

body.light-theme .text-emerald-400 {
    color: #059669;
}

body.light-theme .bg-blue-500\/10 {
    background-color: rgba(59, 130, 246, 0.15);
}

body.light-theme .text-blue-400 {
    color: #1d4ed8;
}

body.light-theme .bg-purple-500\/10 {
    background-color: rgba(168, 85, 247, 0.15);
}

body.light-theme .text-purple-500 {
    color: #8b5cf6;
}

/* Skills section text contrast for light theme */
body.light-theme #skills span.font-medium {
    color: #1f2937;
    font-weight: 600;
}

/* Parcours Scolaire cards contrast for light theme */
body.light-theme .bg-white\/5 {
    background-color: rgba(229, 231, 235, 0.8);
}

body.light-theme .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .bg-white\/5:hover {
    background-color: rgba(209, 213, 219, 0.8);
}

body.light-theme .hover\:bg-white\/10:hover {
    background-color: rgba(209, 213, 219, 0.8);
}

body.light-theme .bg-gray-800 {
    background-color: #e5e7eb;
}

body.light-theme h4.text-white {
    color: #1f2937;
}

/* Project cards hover effects for light theme */
body.light-theme .bento-card.group:hover h3.group-hover\:text-accent {
    color: #4f46e5 !important;
}

body.light-theme .bento-card.group:hover h3.group-hover\:text-emerald-400 {
    color: #059669 !important;
}

body.light-theme .bento-card.group:hover .group-hover\:opacity-100 {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

body.light-theme .bento-card.group:hover .group-hover\:bg-accent2\/20 {
    background-color: rgba(147, 51, 234, 0.3) !important;
}

body.light-theme .bento-card.group:hover .group-hover\:bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.3) !important;
}

/* Certifications Carousel for Mobile */
.certifications-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 1.5rem;
    padding: 0 1rem 1rem 1rem;
    margin: 0 -1rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.certifications-carousel > div {
    flex: 0 0 min(calc(100vw - 3rem), 350px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Scrollbar styling for carousel */
.certifications-carousel::-webkit-scrollbar {
    height: 6px;
}

.certifications-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.certifications-carousel::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

.certifications-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Desktop - Show as grid */
@media (min-width: 768px) {
    .certifications-carousel {
        display: grid;
        overflow-x: auto;
        padding-bottom: 0;
    }
    
    .certifications-carousel > div {
        flex: none;
    }
}
#certifications .bento-card {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}

#certifications .bento-card:hover {
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

/* Certification cards borders in light theme */
body.light-theme #certifications .bento-card {
    border: 1.5px solid rgba(0, 0, 0, 0.35);
}

body.light-theme #certifications .bento-card:hover {
    border: 1.5px solid rgba(0, 0, 0, 0.5);
}

/* Certifications carousel light theme scrollbar */
html.light-theme .certifications-carousel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

html.light-theme .certifications-carousel::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.4);
    border-radius: 3px;
}

html.light-theme .certifications-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.7);
}

/* Contact card border in dark theme */
#contact .bento-card {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}

#contact .bento-card:hover {
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

/* Contact card borders in light theme */
body.light-theme #contact .bento-card {
    border: 1.5px solid rgba(0, 0, 0, 0.35);
}

body.light-theme #contact .bento-card:hover {
    border: 1.5px solid rgba(0, 0, 0, 0.5);
}

/* Skills cards border in dark theme */
#skills .bento-card {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}

#skills .bento-card:hover {
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

/* Skills cards borders in light theme */
body.light-theme #skills .bento-card {
    border: 1.5px solid rgba(0, 0, 0, 0.35);
}

body.light-theme #skills .bento-card:hover {
    border: 1.5px solid rgba(0, 0, 0, 0.5);
}

body.light-theme .bg-black\/20 {
    background-color: rgba(229, 231, 235, 0.6);
}

body.light-theme .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .text-gray-300 {
    color: #475569;
}

/* Keep photo name in white for light theme */
body.light-theme .drop-shadow-lg.text-white {
    color: white !important;
}

/* Keep Contact button text white for light theme */
body.light-theme .btn-shine.text-white {
    color: white !important;
}

/* Keep all white text buttons white for light theme */
body.light-theme .bg-accent.text-white,
body.light-theme .hover\:bg-indigo-600.text-white {
    color: white !important;
}

/* Footer light theme */
body.light-theme footer {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme footer p {
    color: #000000;
}

/* Cartes Email et Localisation du contact en mode sombre */
#contact .grid > div {
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.75rem;
}

/* Cartes Email et Localisation du contact en mode clair */
body.light-theme #contact .grid > div {
    border: 1.5px solid rgba(0, 0, 0, 0.25);
}

/* Logo DB en mode clair */
body.light-theme .px-3.py-1\.5.bg-white\/5 {
    border-color: rgba(0, 0, 0, 0.25) !important;
}
