:root {
    --primary-bg: #ffffff;
    --secondary-bg: rgba(248, 250, 252, 0.95);
    --text-primary: #000000;
    --text-secondary: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #10b981;
    --accent-tertiary: #8b5cf6;
    --accent-hover: #2563eb;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --code-font: 'JetBrains Mono', monospace;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.7;
    transition: all 0.3s ease;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body.dark {
    --primary-bg: #000000;
    --secondary-bg: rgba(20, 20, 20, 0.95); /* Slightly off-black for overlays */
    --text-primary: #ffffff;
    --text-secondary: #cccccc; 
    --accent-primary: #60a5fa;
    --accent-secondary: #34d399;
    --accent-tertiary: #a78bfa;
    --accent-hover: #3b82f6;
    --border: #444444;
    background: #000000; /* Pure black */
}
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    filter: blur(0.4px);          /* soft 2015 look */
    opacity: 0.85;                /* not too overpowering */
}

body {
    background: #000;             /* fallback dark */
}

body:not(.dark) {
    background: #f8f9fa;          /* light mode subtle gray */
}

.overlay {
    background: rgba(0,0,0,0.4);  /* stronger glass in dark */
    backdrop-filter: blur(12px);
}

body:not(.dark) .overlay {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
}

/* Neon glow on hover for links in dark mode */
body.dark .nav-menu a:hover,
body.dark .btn:hover {
    text-shadow: 0 0 12px #00ffff;
}
header.overlay {
    padding: 1rem 3rem; /* Increased padding for PC */
    /* Removed max-width and margin to allow full page fit */
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg); /* Stronger shadow for prominence */
}

.logo { 
    flex: 2; /* Reduced flex for logo to allow more space for menu */
    text-align: left; 
}
.logo-link { 
    font-size: 2rem; /* Larger for desktop impact */
    font-weight: 800; /* Bolder */
    color: var(--accent-primary); 
    text-decoration: none;
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
    position: relative;
    /* Removed overflow: hidden to prevent clipping during animation */
    min-width: 200px; /* Added min-width to ensure full logo appears */
}
.logo-link::before { 
    content: ''; /* Removed PC emoji */
}

.nav-right { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; /* More space */
    flex: 1;
    justify-content: flex-end;
}
.mobile-menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: var(--text-secondary); 
    cursor: pointer; 
    transition: color 0.2s;
}
.mobile-menu-toggle:hover { color: var(--accent-primary); }

.nav-menu { 
    flex: 4; /* Increased flex to allow menu to take more space and fit wider */
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem; /* Adjusted gap for better spacing across full width */
    justify-content: space-evenly; /* Spread items to fit the whole available space */
    width: 100%; /* Ensure ul takes full width of nav-menu */
}
.nav-menu li a { 
    color: var(--text-secondary); 
    text-decoration: none; 
    font-weight: 600; /* Slightly bolder */
    font-size: 1.1rem; /* Larger text */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother easing */
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
    padding: 0.75rem 1.5rem; /* More padding */
    border-radius: 1rem; /* Larger radius for modern look */
    position: relative;
    overflow: hidden; /* For underline effect */
}
.nav-menu li a::after { /* Underline hover effect */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 100%;
}
.nav-menu li a:hover, 
.nav-menu li a.active { 
    color: var(--accent-primary); 
    background: rgba(59, 130, 246, 0.08); /* Subtler bg */
    transform: translateY(-2px); /* Lift on hover */
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15); /* Glow shadow */
}

.nav-menu li a::before { content: none; }

.header-controls { display: flex; gap: 1rem; }
#theme-toggle, #lang-toggle { 
    background: rgba(255, 255, 255, 0.1); /* Subtle bg for buttons */
    backdrop-filter: blur(10px);
    border: 1px solid var(--border); 
    color: var(--text-secondary); 
    padding: 0.75rem 1.25rem; /* Larger padding */
    border-radius: 1rem;
    cursor: pointer; 
    transition: all 0.3s ease;
    font-weight: 500;
}
#theme-toggle:hover, #lang-toggle:hover { 
    border-color: var(--accent-primary); 
    color: var(--accent-primary); 
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}
#profile-cicada {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255,255,255,0.1); /* Keeps subtle light backdrop in light mode */
    padding: 20px;
    transition: filter 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

body.dark #profile-cicada {
    background: transparent; /* Fully transparent – blends perfectly into black background */
    box-shadow: 0 0 30px rgba(255,255,255,0.4); /* Stronger white glow for the inverted (white) cicada */
}

.main { 
    padding: 6rem 3rem 4rem; /* More top/bottom padding */
    max-width: 1400px; /* Wider container */
    margin: 0 auto;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 6rem; /* More space */
    padding: 0 2rem;
    max-width: 800px; /* Constrain for readability */
    margin: 0 auto 6rem;
}
.hero h1 {
    font-size: 4.5rem; /* Larger for PC */
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    letter-spacing: -0.02em; /* Better typography */
}
.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem; /* Larger for PC */
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-secondary));
}
.btn.secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}
.btn.secondary:hover {
    background: var(--accent-primary);
    color: white;
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Wider min-width */
    gap: 2.5rem; /* More gap */
    margin-bottom: 4rem;
}
.card {
    padding: 2.5rem; /* More internal space */
    border-radius: 1.5rem; /* Softer corners */
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}
.card::before { /* Subtle gradient overlay */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card:hover::before {
    opacity: 1;
}
.card:hover {
    transform: translateY(-8px) scale(1.02); /* Enhanced hover lift and scale */
    box-shadow: var(--shadow-lg);
}

.ptech-section {
    text-align: center;
    margin-bottom: 4rem;
}

/* General Card Styles */
.card, .project-card, .trend-card, .intern-card,
.ptech-section, .formation, .experiences, .competences, .week-section {
    background: var(--secondary-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

body.dark .card, body.dark .project-card, body.dark .trend-card, body.dark .intern-card,
body.dark .ptech-section, body.dark .formation, body.dark .experiences, body.dark .competences, body.dark .week-section {
    background: rgba(20, 20, 20, 0.95);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
th, td {
    border: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}
th {
    background: var(--accent-primary);
    color: white;
}

/* Pre/code */
pre {
    background: var(--primary-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: var(--code-font);
}

/* Week Menu */
.week-menu {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.week-menu button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--secondary-bg);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}
.week-menu button:hover, .week-menu button.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}
.week-section {
    display: none;
    animation: fadeIn 0.5s ease;
    background: var(--secondary-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Chatbot */
#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    font-size: 1.5rem;
}
#chatbot-toggle:hover { transform: scale(1.1); }
#chatbot-modal {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}
#chatbot-modal h4 { margin-top: 0; color: var(--accent-primary); }
.chat-option {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}
.chat-option:hover {
    background: var(--accent-primary);
    color: white;
}
body.dark .chat-option { background: var(--primary-bg); }

/* Footer */
footer.overlay { 
    padding: 2rem; 
    text-align: center; 
    border-top: 1px solid var(--border); 
    margin-top: 4rem; 
}
footer a { 
    color: var(--accent-primary); 
    text-decoration: none; 
    transition: color 0.2s; 
}
footer a:hover { 
    color: var(--accent-secondary); 
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Dark mode adjustments for enhancements */
body.dark .card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
body.dark .btn {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
body.dark .btn:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Mobile */
@media (max-width: 768px) {
    header.overlay { padding: 1rem; }
    .nav-menu { 
        display: none; 
        flex-direction: column; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: var(--secondary-bg); 
        padding: 1rem; 
        box-shadow: var(--shadow); 
        gap: 1rem; 
        z-index: 99; 
    }
    .nav-menu.open { display: flex; }
    .mobile-menu-toggle { display: block; }
    .main { padding: 2rem 1rem; }
    .hero h1 { font-size: 2.5rem; }
    .featured-grid, .projects-grid, .trends-grid, .internships-grid { grid-template-columns: 1fr; }
    .week-menu { 
        flex-direction: column; 
        align-items: center; 
        gap: 0.75rem; 
    }
    #chatbot-modal { width: 90%; right: 5%; }
    
    .nav-menu.open {
        justify-content: center;
        text-align: center;
    }
    .nav-menu ul {
        justify-content: center; /* For mobile, center instead of space-evenly */
        gap: 1rem;
    }
}
/* Professional Presentation Hero */
/* Specific adjustment for qui-suis-je page if needed */
.presentation-hero .profile-img#profile-cicada {
    width: 200px;
    height: 200px;
    padding: 25px;
}
.presentation-content {
    max-width: 800px;
    margin: 0 auto;
}
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}
.presentation-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}
.presentation-hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.skills-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.skills-list li {
    background: var(--secondary-bg);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Quick Links Section */
.quick-links {
    text-align: center;
    margin-bottom: 4rem;
}
.quick-links h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent-primary);
}
.quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Custom Animated Cursor */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: rgba(59, 130, 246, 0.8); /* Matches accent-primary */
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s ease;
    z-index: 1000;
    mix-blend-mode: difference; /* Cool blend effect */
}
.cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: rgba(16, 185, 129, 0.6); /* Matches accent-secondary */
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide default cursor */
body {
    cursor: none;
}
.portfolio-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
}

.portfolio-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Section Alertes Google */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.alert-item {
    background: var(--secondary-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-tertiary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alert-item:hover::before {
    opacity: 1;
}

.alert-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.alert-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.alert-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.alert-title a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.alert-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.alert-summary {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limite à 3 lignes pour compacité */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alert-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.alert-link:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateX(4px);
}

/* Dark mode pour alertes */
body.dark .alert-item {
    background: rgba(30, 41, 59, 0.9);
}

body.dark .alert-link {
    background: rgba(96, 165, 250, 0.2);
}

body.dark .alert-link:hover {
    background: var(--accent-primary);
}

/* Mobile */
@media (max-width: 768px) {
    .alerts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
.quote-section {
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
}

.quote-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.quote-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--accent-primary);
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.4s;
    letter-spacing: -0.5px;
}

.quote-author {
    margin-top: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0;
    animation: fadeInUp 1.6s ease-out forwards;
    animation-delay: 1.2s;
}

/* Glow pulse effect on hover */
.quote-text:hover {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    from {
        text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    }
    to {
        text-shadow: 0 0 35px rgba(59, 130, 246, 0.8), 0 0 60px rgba(59, 130, 246, 0.4);
    }
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .quote-text {
        font-size: 1.8rem;
    }
    
    .quote-author {
        font-size: 1.1rem;
    }
}