/* style-cours.css */

:root {
    --bg-color: #f4f7f9;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --accent-blue: #0984e3;
    --accent-glow: rgba(9, 132, 227, 0.2);
    --border-color: #dfe6e9;
    --card-bg: #ffffff;
    --radius: 12px;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- Header --- */
header { padding: 40px 20px 20px; max-width: 1400px; margin: 0 auto; }
.header-content { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.logo-container img { max-height: 70px; display: block; transition: transform 0.3s; }
.logo-container img:hover { transform: scale(1.05) rotate(-5deg); }

.title-container { display: flex; flex-direction: column; justify-content: center; }
h1 { color: #2d3436; font-size: 2.2rem; margin: 0; font-weight: 800; letter-spacing: 1px; }
.tagline { font-size: 1rem; color: var(--accent-blue); margin: 0; font-weight: 600; }
.header-divider { width: 100%; border-bottom: 2px solid var(--border-color); }

/* --- Top Icon Row --- */
.top-icon-row {
    max-width: 1400px; margin: 20px auto; padding: 0 20px;
    display: flex; gap: 20px; justify-content: center;
}
.img-icon-link { display: inline-block; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.img-icon-link img {
    width: 45px; height: auto; display: block;
    background: var(--card-bg); border-radius: 50%; padding: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: opacity 0.2s ease;
}
.img-icon-link:hover { transform: translateY(-5px) scale(1.1); }

/* --- 3-COLUMN LAYOUT --- */
.main-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 30px; max-width: 1400px; margin: 40px auto;
    padding: 0 20px; align-items: start;
}

/* Containers */
.journal-entry, .sidebar-box {
    background: var(--card-bg); padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journal-entry:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.08); }

/* Sticky Right Sidebar */
.sticky-sidebar {
    position: -webkit-sticky; position: sticky;
    top: 20px; z-index: 10; padding: 15px;
}

.sidebar-title {
    font-size: 1.1rem; font-weight: 700; color: var(--accent-blue);
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 10px; margin-top: 0;
}

/* --- Lesson Content Styling --- */
.badge {
    background: linear-gradient(135deg, #74b9ff, #0984e3); color: white;
    padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold;
}
.lesson-header h2 { font-size: 2.5rem; margin: 10px 0; color: #2d3436; }
.author-meta { font-size: 0.9rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }

/* Formula Box (Gamified) */
.formula-box {
    background: #f8f9fa; border-left: 4px solid var(--accent-blue);
    padding: 20px; margin: 25px 0; border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 1.1rem; transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.formula-box:hover {
    background: white; border-left-color: #00d2d3;
    box-shadow: 0 8px 25px var(--accent-glow); transform: translateX(5px);
}

/* Astuce Box */
.astuce-box {
    background: #fff9c4; padding: 20px; border-radius: var(--radius);
    margin: 25px 0; font-size: 0.95rem; color: #b78a00;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.15);
}
.astuce-box p { color: #2d3436; }

/* --- Left Nav Menu --- */
.lesson-nav { list-style: none; padding: 0; }
.lesson-nav li { margin-bottom: 10px; }
.lesson-nav a {
    text-decoration: none; color: var(--text-main); font-weight: 500;
    transition: color 0.2s, padding-left 0.2s; display: block;
}
.lesson-nav a:hover { color: var(--accent-blue); padding-left: 5px; }

/* --- Lightbox & Images --- */
.zoomable-img { width: 100%; border-radius: 8px; cursor: zoom-in; transition: transform 0.3s; }
.zoomable-img:hover { transform: scale(1.02); }
.caption { text-align: center; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

.lightbox-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 20, 25, 0.95); backdrop-filter: blur(5px);
    z-index: 9999; justify-content: center; align-items: center; opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox-overlay.active { display: flex; opacity: 1; }
.lightbox-overlay img { max-width: 90%; max-height: 90%; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); transform: scale(0.8); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.lightbox-overlay.active img { transform: scale(1); }
.lightbox-close-btn { position: absolute; top: 20px; right: 40px; color: white; font-size: 50px; cursor: pointer; transition: transform 0.2s; }
.lightbox-close-btn:hover { transform: rotate(90deg); color: #ff7675; }

/* --- Scroll Animations --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.slide-up { animation: slideUpFade 0.6s ease-out backwards; }
.slide-up:nth-child(1) { animation-delay: 0.1s; }
.slide-up:nth-child(2) { animation-delay: 0.2s; }
.slide-up:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1100px) { .main-wrapper { grid-template-columns: 1fr 300px; } .main-wrapper > aside:first-of-type { display: none; } }
@media (max-width: 850px) { .main-wrapper { grid-template-columns: 1fr; } .main-wrapper > aside:first-of-type { display: none; } .sticky-sidebar { position: relative; top: 0; } }



/* --- Floating Background Bubbles (Cours Edition) --- */
#bubble-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    pointer-events: none; 
    overflow: hidden;
}

.floating-bubble {
    position: absolute;
    bottom: -100px;
    /* Une couleur subtile pour ne pas gêner la lecture des formules */
    background: rgba(9, 132, 227, 0.04); 
    border-radius: 50%;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120vh) rotate(360deg); opacity: 0; }
}
