/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    font-family: 'Space Mono', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Cascadia Code', 'Ubuntu Mono', 'Inconsolata', monospace;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

#bloc_page {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    #bloc_page {
        width: 100%;
        padding: 0 15px;
    }
}

section h1, footer h1, nav a {
    font-family: 'Space Mono', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Cascadia Code', 'Ubuntu Mono', 'Inconsolata', monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modern Header */
header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 20px 0;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Modern Navigation */
nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin-top: 15px;
}

@media (max-width: 768px) {
    nav {
        justify-content: center;
        margin-top: 20px;
    }
}

nav ul {
    list-style-type: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

nav li {
    display: flex;
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

nav a {
    font-size: 0.95rem;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

nav a:hover {
    background: rgba(66, 165, 245, 0.2);
    border-color: rgba(66, 165, 245, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 165, 245, 0.3);
}

nav #en-cours a {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    border-color: rgba(66, 165, 245, 0.6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.4);
}

nav #en-cours a:hover {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(66, 165, 245, 0.5);
}


a {
    color: #42a5f5;
    transition: color 0.3s ease;
}

a:hover {
    color: #66bb6a;
}

#titre_principal {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    #titre_principal {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

header h1 {
    font-family: 'Space Mono', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Cascadia Code', 'Ubuntu Mono', 'Inconsolata', monospace;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: #66bb6a;
    text-shadow: 0 0 10px rgba(102, 187, 106, 0.4);
    text-align: center;
}

/* Responsivité des images ASCII des titres */
#titre_principal img {
    max-width: 100% !important;
    height: auto !important;
    max-height: clamp(60px, 8vw, 100px) !important;
}

@media (max-width: 768px) {
    #titre_principal img {
        max-width: 90% !important;
        max-height: clamp(50px, 10vw, 80px) !important;
    }
}

@media (max-width: 480px) {
    #titre_principal img {
        max-width: 85% !important;
        max-height: clamp(40px, 12vw, 70px) !important;
    }
}

.ascii-art {
    font-family: 'DepartureMono Nerd Font', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', monospace;
    font-size: clamp(1.2rem, 4vw, 2rem);
    line-height: 1.3;
    color: #66bb6a;
    text-shadow: 0 0 5px rgba(102, 187, 106, 0.3);
    margin: 0;
    white-space: pre;
    text-align: center;
    font-weight: 600;
}

.terminal-prompt {
    display: block;
    font-family: 'DepartureMono Nerd Font', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #42a5f5;
    text-shadow: 0 0 10px rgba(66, 165, 245, 0.8);
    margin-top: 15px;
    font-weight: 600;
}

aside h2 {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #42a5f5, #66bb6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 2px solid rgba(66, 165, 245, 0.3);
    padding-bottom: 10px;
}

aside h1 {
    font-size: 1.2rem;
    margin: 20px 0 15px 0;
    color: #66bb6a;
    border-bottom: 1px solid rgba(102, 187, 106, 0.3);
    padding-bottom: 8px;
}

#logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

#logo:hover {
    transform: scale(1.1) rotate(5deg);
}

@media (max-width: 768px) {
    #logo {
        width: 50px;
        height: 50px;
    }
}

header h2 {
    font-family: 'Space Mono', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Cascadia Code', 'Ubuntu Mono', 'Inconsolata', monospace;
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

@media (max-width: 768px) {
    header h2 {
        font-size: 1rem;
    }
}

/* Modern Banner */
#banniere_image {
    margin: 30px 0;
    height: clamp(250px, 35vw, 400px);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.2), rgba(102, 187, 106, 0.2)), url('lycee.jpg') center/cover no-repeat;
    position: relative;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(66, 165, 245, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: contrast(1.1) brightness(1.05);
    border: 1px solid rgba(66, 165, 245, 0.3);
}

#banniere_image:hover {
    transform: scale(1.03) translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(66, 165, 245, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    filter: contrast(1.2) brightness(1.1) saturate(1.1);
    border-color: rgba(66, 165, 245, 0.6);
}

#banniere_image::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: scanline 3s infinite;
    pointer-events: none;
}

/* Bannière spécifique pour BTS CIEL 1 */
.ciel1-page #banniere_image {
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2)), url('images/ciel1.png') center/cover no-repeat !important;
}

/* Bannière spécifique pour BTS CIEL 2 */
.ciel2-page #banniere_image {
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2)), url('images/CIEL2.png') center/cover no-repeat !important;
}

#banniere_image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(66, 165, 245, 0.1), rgba(102, 187, 106, 0.1));
    pointer-events: none;
}

#banniere_description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}


/* Modern Content Layout */
section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 40px 0;
}

@media (min-width: 768px) {
    section {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
}

@media (min-width: 1200px) {
    section {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 30px;
    }
}

article {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    grid-column: 1 / -1;
}

@media (min-width: 1200px) {
    article {
        grid-column: 1 / 3;
    }
}

article:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ico_categorie {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 12px;
    filter: drop-shadow(0 0 5px rgba(66, 165, 245, 0.5));
}

article p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

article h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #42a5f5;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(66, 165, 245, 0.3);
    padding-bottom: 10px;
}

aside {
    position: relative;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.1), rgba(102, 187, 106, 0.1));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

aside:hover {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.15), rgba(102, 187, 106, 0.15));
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

#fleche_bulle {
    position: absolute;
    top: 80px;
    left: -15px;
    filter: drop-shadow(0 0 10px rgba(66, 165, 245, 0.5));
    transition: transform 0.3s ease;
}

#fleche_bulle:hover {
    transform: scale(1.1);
}

#news {
    text-align: center;
    margin-top: 15px;
}

#news img {
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#news img:hover {
    border-color: rgba(66, 165, 245, 0.4);
    transform: scale(1.05);
}

aside img {
    margin-right: 8px;
    filter: brightness(1.1);
}

#cours, #TP, #doc {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#cours {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.1), rgba(33, 150, 243, 0.05));
}

#TP {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.1), rgba(76, 175, 80, 0.05));
}

#doc {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.1), rgba(255, 152, 0, 0.05));
}

#cours:hover, #TP:hover, #doc:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

#cours:hover {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.15), rgba(33, 150, 243, 0.08));
}

#TP:hover {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.15), rgba(76, 175, 80, 0.08));
}

#doc:hover {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.15), rgba(255, 152, 0, 0.08));
}

#cours h1, #TP h1, #doc h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

#cours h1 {
    color: #42a5f5;
    border-bottom: 2px solid rgba(66, 165, 245, 0.3);
}

#TP h1 {
    color: #66bb6a;
    border-bottom: 2px solid rgba(102, 187, 106, 0.3);
}

#doc h1 {
    color: #ffa726;
    border-bottom: 2px solid rgba(255, 167, 38, 0.3);
}

#cours p, #TP p, #doc p {
    margin-bottom: 10px;
    line-height: 1.6;
}

#cours p li a, #TP p li a, #doc p li a {
    display: inline-block;
    padding: 8px 15px;
    margin: 3px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

#cours p li a:hover {
    background: rgba(66, 165, 245, 0.2);
    border-color: rgba(66, 165, 245, 0.4);
    color: #ffffff;
    transform: translateX(5px);
}

#TP p li a:hover {
    background: rgba(102, 187, 106, 0.2);
    border-color: rgba(102, 187, 106, 0.4);
    color: #ffffff;
    transform: translateX(5px);
}

#doc p li a:hover {
    background: rgba(255, 167, 38, 0.2);
    border-color: rgba(255, 167, 38, 0.4);
    color: #ffffff;
    transform: translateX(5px);
}

/* Advanced Animations and Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scanline {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(66, 165, 245, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(66, 165, 245, 0.8));
    }
}

/* Apply animations */
#bloc_page {
    animation: fadeInUp 0.8s ease-out;
}

header {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

#banniere_image {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

section > div {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

article {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

aside {
    animation: fadeInUp 0.8s ease-out 1s both;
}

/* Particle effect background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(66, 165, 245, 0.2), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(102, 187, 106, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 167, 38, 0.2), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(66, 165, 245, 0.2), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(102, 187, 106, 0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Modern scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #42a5f5, #66bb6a);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e88e5, #4caf50);
}

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 2px solid #42a5f5;
    outline-offset: 2px;
}

/* Loading animation for links */
#cours p li a, #TP p li a, #doc p li a {
    position: relative;
    overflow: hidden;
}

#cours p li a::after,
#TP p li a::after,
#doc p li a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

#cours p li a:hover::after,
#TP p li a:hover::after,
#doc p li a:hover::after {
    left: 100%;
}

