﻿:root {
    /* Header/Footer - Glassmorphism Light (Dark Sand Tint) */
    --color-header-bg: rgba(209, 196, 176, 0.95);
    --color-header-text: #2E1A16;
    --color-header-border: rgba(92, 70, 54, 0.3);

    /* Couleurs principales */
    --color-primary-dark: #5c4636;
    --color-accent-main: #A0522D;
    --color-text-main: #2E1A16;

    /* Fond */
    --color-background-main: #F9F5F0;

    /* Cartes */
    --color-card-background: #ffffff;
    --color-card-border: #886547;
    --color-card-hover: #fcfbf9;
    --color-footer-bg: #3E2723;
    --color-footer-text: #F9F5F0;

    /* Variables RGB pour les particules */
    --color-particle-main: 92, 70, 54;
}

body.dark-mode {
    /* Header/Footer - Glassmorphism Dark */
    --color-header-bg: rgba(26, 18, 11, 0.95);
    --color-header-text: #E6E0D4;
    --color-header-border: rgba(160, 82, 45, 0.3);

    /* Couleurs principales */
    --color-primary-dark: #A0522D;
    --color-accent-main: #D2691E;
    --color-text-main: #E6E0D4;

    /* Fond */
    --color-background-main: #1A120B;

    /* Cartes */
    --color-card-background: #2C241F;
    --color-card-border: #5c4636;
    --color-card-hover: #3E2723;
    --color-footer-bg: #0F0A08;
    --color-footer-text: #D1D5DB;

    /* Variables RGB pour les particules */
    --color-particle-main: 230, 224, 212;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background-main);
    color: var(--color-text-main);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Nouvelle classe pour les fonds qui s'adaptent au thème */
.bg-theme-card {
    background-color: var(--color-card-background);
    transition: background-color 0.5s ease;
}

/* Classes pour les animations d'apparition au défilement */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Effet spécial pour les images des projets */
.project-image-animate {
    filter: grayscale(100%);
    transition: filter 0.5s ease-in-out;
}

.card-item:hover .project-image-animate {
    filter: grayscale(0%);
}

/* Style pour le header et footer */
header {
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-header-border);
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-header-border);
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

/* Style des liens de navigation au survol */
header .nav-link:not([data-page=""]):hover,
header .nav-link[data-page]:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-primary-dark);
}

/* Pour s'assurer que les cartes de stage/projet ont un fond cohérent */
.card-item {
    background-color: var(--color-card-background);
    border: 1px solid var(--color-card-border);
    border-radius: 0.75rem;
    transition: all 0.3s ease-in-out, background-color 0.5s ease, border-color 0.5s ease;
}

.card-item:hover {
    background-color: var(--color-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* Assure que le texte dans les cartes s'adapte au thème */
.card-item h3,
.card-item p,
.card-item li,
.card-item span {
    color: var(--color-text-main);
    transition: color 0.5s ease;
}

.card-item span {
    background-color: var(--color-card-border);
    color: var(--color-text-main);
}

/* Cacher les sections par défaut pour la navigation à page unique */
.page-section {
    display: none;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.page-section.active {
    display: block;
}

.text-brand {
    color: var(--color-accent-main);
}

/* Assurer que les icônes SVG dans le footer sont bien visibles et s'adaptent au thème */
footer svg {
    fill: currentColor;
}

/* Style pour le bouton hamburger */
#menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Amélioration visuelle pour les boutons */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: inline-flex;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: var(--color-accent-main);
    color: #FFFFFF;
}

.btn-secondary {
    background-color: var(--color-primary-dark);
    color: white;
}

.btn-secondary:hover {
    background-color: #3730a3;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Assurer que le menu hamburger est bien au-dessus du contenu si besoin */
#main-navigation {
    z-index: 50;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--color-card-background);
    color: var(--color-text-main);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), background-color 0.5s ease, color 0.5s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--color-text-main);
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--color-accent-main);
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--color-accent-main);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Typewriter Effect (Révélation progressive) */
@keyframes reveal-text {
    from {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }

    to {
        clip-path: inset(0 0% 0 0);
        opacity: 1;
    }
}

.text-reveal {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    display: inline-block;
    white-space: nowrap;
    animation-fill-mode: forwards;
}

/* Specific animation for the first line */
.home-line-1-typewriter {
    animation: reveal-text 2s steps(25, end) forwards;
}

/* Blinking cursor for the main heading's brand text */
.home-heading .text-brand-blinking-cursor {
    border-right: .15em solid transparent;
    animation: blink-caret .75s step-end infinite;
    animation-delay: 2s;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--color-accent-main);
    }
}

/* Easter Egg Message Styling */
#easter-egg-message {
    background-color: var(--color-primary-dark);
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 1000;
}

#easter-egg-message.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
}

/* Styles pour les icônes du thème */
#icon-sun,
#icon-moon {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Mode Clair par défaut : Soleil visible, Lune cachée */
#icon-sun {
    opacity: 1;
    transform: rotate(0deg);
    display: block;
}

#icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
    display: none;
}

/* Mode Sombre : Lune visible, Soleil caché */
body.dark-mode #icon-sun {
    opacity: 0;
    transform: rotate(90deg);
    display: none;
}

body.dark-mode #icon-moon {
    opacity: 1;
    transform: rotate(0deg);
    display: block;
}

/* Animated background canvas */
#animated-background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
    background-color: transparent;
}

/* - - - Vertical Timeline Styles - - - */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Central Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--color-card-border);
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
    opacity: 0;
    transition: all 0.5s ease-out;
}

/* Left and Right positioning */
.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--color-accent-main);
    border: 4px solid var(--color-background-main);
    border-radius: 50%;
    top: 30px;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(160, 82, 45, 0.2);
    transition: all 0.3s ease;
}

.timeline-item.left .timeline-dot {
    right: -10px;
}

.timeline-item.right .timeline-dot {
    left: -10px;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(160, 82, 45, 0.3);
}

/* Date Label */
.timeline-date {
    position: absolute;
    top: 30px;
    font-weight: 800;
    color: var(--color-accent-main);
    font-size: 0.9rem;
    letter-spacing: 1px;
    z-index: 5;
}

.timeline-item.left .timeline-date {
    right: -140px;
    text-align: left;
}

.timeline-item.right .timeline-date {
    left: -140px;
    text-align: right;
}

/* Content Card */
.timeline-content {
    position: relative;
    border-radius: 1rem;
    padding: 25px;
    background-color: var(--color-card-background);
    border: 1px solid var(--color-card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Arrow indicator */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 1;
}

.timeline-item.left .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--color-card-border);
}

.timeline-item.left .timeline-content::after {
    content: '';
    position: absolute;
    top: 31px;
    right: -9px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 0 9px 9px;
    border-color: transparent transparent transparent var(--color-card-background);
    z-index: 2;
}

.timeline-item.right .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--color-card-border) transparent transparent;
}

.timeline-item.right .timeline-content::after {
    content: '';
    position: absolute;
    top: 31px;
    left: -9px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 9px 9px 0;
    border-color: transparent var(--color-card-background) transparent transparent;
    z-index: 2;
}

/* Animations (Transition based) */
.timeline-item.is-visible {
    opacity: 1;
}

.timeline-item.left {
    transform: translateX(-50px);
}

.timeline-item.right {
    transform: translateX(50px);
}

.timeline-item.left.is-visible,
.timeline-item.right.is-visible {
    transform: translateX(0);
}

/* ========== RESPONSIVE DESIGN ========== */

/* Mobile Navigation */
@media (max-width: 640px) {
    #main-navigation {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-header-bg);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--color-header-border);
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
    }

    #main-navigation.active {
        transform: translateY(-100%);
    }

    #main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid var(--color-header-border);
        text-align: center;
    }
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
    }

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
        text-align: left;
        transform: translateY(30px);
    }

    .timeline-item.left .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: 20px;
        right: auto;
    }

    .timeline-item.left .timeline-date,
    .timeline-item.right .timeline-date {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin-bottom: 10px;
        display: block;
        text-align: left;
    }

    /* Adjust arrows for mobile (always on left) */
    .timeline-item.left .timeline-content::before,
    .timeline-item.right .timeline-content::before {
        left: -10px;
        right: auto;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--color-card-border) transparent transparent;
    }

    .timeline-item.left .timeline-content::after,
    .timeline-item.right .timeline-content::after {
        left: -9px;
        right: auto;
        border-width: 9px 9px 9px 0;
        border-color: transparent var(--color-card-background) transparent transparent;
    }

    /* Simplify animations on mobile */
    .timeline-item.left.is-visible,
    .timeline-item.right.is-visible {
        transform: translateY(0);
    }

    /* Grids to Single Column */
    .grid-cols-2,
    .md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ========== ABOUT SECTION PREMIUM ========== */

/* About Section Container */
.about-section-premium {
    position: relative;
    overflow: hidden;
}

/* Animated Gradient Title */
.about-title-gradient {
    background: linear-gradient(135deg, var(--color-accent-main), var(--color-primary-dark), var(--color-accent-main));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Glassmorphism Cards */
.glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode .glass-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Floating Animation */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Animated Glow Effect */
.about-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(160, 82, 45, 0.15) 0%, transparent 70%);
    animation: rotate-glow 10s linear infinite;
    pointer-events: none;
}

@keyframes rotate-glow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Profile Image Container */
.about-image-container {
    position: relative;
    perspective: 1000px;
}

.about-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.about-image-wrapper:hover {
    transform: rotateY(10deg) rotateX(5deg) scale(1.05);
}

/* Animated Rings Around Profile Image */
.about-image-ring,
.about-image-ring-2 {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    animation: pulse-ring 3s ease-in-out infinite;
}

.about-image-ring {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-color: var(--color-accent-main);
    opacity: 0.3;
}

.about-image-ring-2 {
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    border-color: var(--color-primary-dark);
    opacity: 0.2;
    animation-delay: 1.5s;
}

@keyframes pulse-ring {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }
}

/* Profile Image */
.about-profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--color-card-background);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    transition: all 0.4s ease;
}

.about-profile-image:hover {
    box-shadow: 0 15px 60px rgba(160, 82, 45, 0.4);
}

/* Text Fade In Animation */
.about-text-fade {
    opacity: 0;
    animation: fade-in-up 0.8s ease forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlighted Text */
.about-highlight {
    position: relative;
    color: var(--color-accent-main);
    font-weight: 700;
    padding: 0 4px;
}

.about-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent-main), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Section Titles with Icons */
.about-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-main);
}

.about-icon {
    font-size: 1.75rem;
    display: inline-block;
    animation: bounce-icon 2s ease-in-out infinite;
}

@keyframes bounce-icon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Skill Items */
.skill-item {
    opacity: 0;
    animation: slide-in-right 0.6s ease forwards;
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Skill Bar Container */
.skill-bar-container {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.dark-mode .skill-bar-container {
    background: rgba(255, 255, 255, 0.05);
}

/* Animated Skill Bar */
.skill-bar {
    position: relative;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-accent-main));
    border-radius: 10px;
    animation: fill-bar 1.5s ease-out forwards;
    animation-delay: var(--skill-delay, 0s);
    box-shadow: 0 0 10px rgba(160, 82, 45, 0.5);
}

.skill-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer-bar 2s ease-in-out infinite;
}

@keyframes fill-bar {
    from {
        width: 0;
    }

    to {
        width: var(--skill-width, 0%);
    }
}

@keyframes shimmer-bar {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Skill Percentage */
.skill-percentage {
    font-weight: 700;
    color: var(--color-accent-main);
    font-size: 0.95rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .about-image-wrapper {
        width: 150px;
        height: 150px;
    }

    .about-profile-image {
        width: 150px;
        height: 150px;
    }

    .about-title-gradient {
        font-size: 2rem;
    }
}

/* Scroll-triggered visibility for About section */
.about-section-premium .scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 3D Hover Effect for Cards */
.glass-card {
    transform-style: preserve-3d;
}

.glass-card:hover {
    transform: translateY(-15px) rotateX(2deg) rotateY(2deg);
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
*:focus-visible {
    outline: 3px solid var(--color-accent-main);
    outline-offset: 3px;
    border-radius: 4px;
}