/* Dark Mode Variables & Base Styles */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --heading-color: #0077B6;
    --border-color: #e0e0e0;
}

/* Deep Black Dark Mode Overrides */
body.dark-mode {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --card-bg: rgba(20, 20, 20, 0.8);
    --heading-color: #ffffff;
    --border-color: #333;

    /* Make these transparent to show the Deep Black background and particles */
    --light-color: transparent;
    --light-alt-color: transparent;
    --section-background: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Particles container - Full height, fixed */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

body.dark-mode #particles-js {
    opacity: 1;
}

/* Hide overlays and decorative shapes in Dark Mode */
body.dark-mode .bg-overlay,
body.dark-mode .section-background {
    display: none !important;
    opacity: 0 !important;
}

/* =========================================
   GROUP 1: Keep Backgrounds 
   (Cards, Tools, Soft Skills, Form) 
   ========================================= */
body.dark-mode .outil-category,
body.dark-mode .projet-card,
body.dark-mode .ss-content,
body.dark-mode .contact-form {
    backdrop-filter: blur(5px);
    background-color: var(--card-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   GROUP 2: Remove Backgrounds & Enhance Text (Floating Text Look)
   Applied to: Competences, Experiences, Formations, Contact Info, Anglais 
   AND Project Detail Pages (SAE)
   ========================================= */
body.dark-mode .competence-category,
body.dark-mode .timeline-content,
body.dark-mode .timeline-content-horizontal,
body.dark-mode .contact-item,
body.dark-mode .anglais-block,
/* Project Detail Page Elements */
body.dark-mode .projet-detail-container,
body.dark-mode .projet-section,
body.dark-mode .projet-header,
body.dark-mode .competence-item {
    background-color: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

/* Text Visibility Enhancements for GROUP 2 (Floating Text) */
body.dark-mode .competence-category h3,
body.dark-mode .competence-category h4,
body.dark-mode .competence-category p,
body.dark-mode .timeline-content h3,
body.dark-mode .timeline-content h4,
body.dark-mode .timeline-content p,
body.dark-mode .timeline-content li,
body.dark-mode .timeline-content-horizontal h3,
body.dark-mode .timeline-content-horizontal h4,
body.dark-mode .timeline-content-horizontal p,
body.dark-mode .contact-item h3,
body.dark-mode .contact-item p,
body.dark-mode .contact-item a,
body.dark-mode .anglais-block h3,
body.dark-mode .anglais-block p,
/* Project Detail Text */
body.dark-mode .projet-title,
body.dark-mode .projet-subtitle,
body.dark-mode .projet-intro,
body.dark-mode .projet-section h2,
body.dark-mode .projet-section h3,
body.dark-mode .projet-section p,
body.dark-mode .projet-section li,
body.dark-mode .competence-item {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Navbar & Footer Specifics for Dark Mode */
body.dark-mode .navbar {
    background-color: rgba(5, 5, 5, 0.95) !important;
    border-bottom: 1px solid #333;
}

body.dark-mode footer {
    background-color: #000000 !important;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--heading-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Fix: Invert icon color in Dark Mode (Black icon on White button) */
body.dark-mode .theme-toggle {
    color: #050505;
    /* Black Icon */
    background-color: #ffffff;
    /* White Button */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    /* Glow effect */
}

/* Animation Keyframes */
@keyframes rotate-icon {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes pulse-btn {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Animation Classes */
.theme-toggle.animate i {
    animation: rotate-icon 0.5s ease-in-out;
}

.theme-toggle.animate {
    animation: pulse-btn 0.3s ease-in-out;
}