/* Global Styles */
:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --header-bg: white;
    --card-bg: white;
    --primary-color: #0056b3;
    --secondary-color: #003d7a;
    --hover-color: #ff831d;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --footer-bg: #1a1a2e;
    --footer-text: white;
    --border-color: #eee;
    --info-box-bg: #e8f4ff;
    --parcolor: #666;
    --h4color: #0056b3;
    --h2color : #0056b3;
    --btncolor: #0056b3;
    --bordercard: #ff831d;
    --yearsection : #0056b3;
    --semestersection: #007bff;
    --gradient1: #CDC1FF;
    --herop : #4B5563FF;
    --heroh2 : #474F7A;
    --borderbottom : #0056b3;
    --bordertop : linear-gradient(90deg, #0056b3, #00a8ff);
    --gradient2 : #EEEEEE;
    --borderleft : #0056b3;
    --bg-img: #f0F0F0;
}

[data-theme="dark"] {
    --bg-color: #0a0a20;
    --text-color: #e0e0e0;
    --header-bg: #0e1329;
    --card-bg: transparent;
    --primary-color: #4a8fe7;
    --secondary-color: #2a6fd9;
    --hover-color: #ff9f4d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --footer-bg: #0a0a15;
    --footer-text: #e0e0e0;
    --border-color: #2a2a4a;
    --info-box-bg: #1a1a3a;
    --parcolor : white;
    --h4color: white;
    --h2color : white;
    --btncolor: #BE7B72;
    --bordercard: #7965C1;
    --yearsection: #535C91;
    --semestersection: #9290C3;
    --gradient : linear-gradient(125deg, #FFE1FF, #E4B1F0);
    --herop : white;
    --heroh2 : white;
    --borderbottom : #E4B1F0;
    --bordertop : linear-gradient(90deg, #7E60BF, #E4B1F0);
    --gradient2 : linear-gradient(125deg, #4FBDBA, #98BAE7);
    --borderleft : #FFE1FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin : 0;
    padding: 0;
}

/* Dark mode galaxy background with particles */
[data-theme="dark"] body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg, #27214f, #013051, #0f0f2a, #2a2a4a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -2;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
[data-theme="dark"] canvas#galaxy {
    opacity: 1;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;

}
canvas#galaxy {
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}


ul {
    list-style: none;
}

.btn {
    display: inline-block;
    color: var(--text-color);
    padding: 6px 8px;
    border-radius: 16px;
    font-size: 0.95rem;
    transition: all 0.3s;
    margin: 5px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--btncolor);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.btn:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

header {
    background-color: var(--header-bg);
    padding: 8px 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
    border-radius: 40px;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    left : 50%;
    position: fixed;
    top: 25px;
    z-index: 100;
    border-bottom: 2px solid var(--borderleft);
    margin-left: auto;
    margin-right: auto;

}


.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

[data-theme="dark"] #theme-toggle-btn {
    color: #FFD700;
}

#theme-toggle-btn:hover {
    transform: rotate(30deg);
}

[data-theme="dark"] #theme-toggle-btn:hover {
}
[data-theme="dark"] .logo img {
    filter: brightness(0) invert(1);
}


header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    width : 100%;
    padding: 0 30px;
}
.navbar-container{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap : 19px;
}
.logo {
    display: block;
    align-items: center;
    gap: 10px;
}

.logo img {
    max-width: 120px;
}

a {
    text-decoration: none;
    color: inherit;
}

.logo p {
    font-size: 0.85rem;
    color: #666;
    margin : 0;
    font-weight: 500;
}

nav  {
    display: flex;
    align-items: center;
    margin-left: 20px;
    gap : 10px;
}


nav a {
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 12px;
}

nav a:hover, nav a.active {
    color: var(--borderleft);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--borderleft);
}


/* Hero Section */
.hero {
    position: relative;
    border-radius: 0;
    padding: 80px 40px 20px;
    width: 100%;
    overflow: hidden;
}
.blur-square1 {
    position: fixed;
    width: 700px;
    height: 900px;
    left : 50%;
    top : 0;
    margin : -500px -800px;
    background: var(--gradient1); /* Or any other color */
    filter: blur(100px); /* Adjust the blur radius */
    opacity: 0.3; /* Make it soft */
    z-index: -1; /* Send it to the background */
    border-radius: 20px; /* Optional: for rounded edges */
    rotate: -80deg;
}
@keyframes fadeout {
    to {
        opacity: 0;
        filter: blur(200px);
        transform: scale(1.2);
    }
}
.fadeout {
    animation: fadeout 1s ease-in-out forwards;
}
@keyframes fadein {
    0% { opacity : 0;}
    100% { opacity : 0.4;}
}
.fadein {
    animation: fadein 1s ease-in-out forwards;
}
.blur-square2 {
    position: fixed;
    width: 400px;
    height: 700px;
    top : 0;
    left : 50%;
    margin : -350px 70px;
    background: var(--gradient2); /* Or any other color */
    filter: blur(100px); /* Adjust the blur radius */
    opacity: 0.4; /* Make it soft */
    z-index: -1; /* Send it to the background */
    border-radius: 20px; /* Optional: for rounded edges */
    rotate: 40deg;
}

.hero * {
    position: relative;
    z-index: 2;
}
.hero h2 {
    color: var(--heroh2);
    font-size: 2.5rem;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 20px;
}

.hero p {
    color: var(--herop);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 30px;
}
/* Programs Section */
.programs {
    padding: 20px 0;
    text-align: center;
    flex: 1;
}

.branches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.branch{
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(1px) saturate(180%);
    border: 0.0625rem solid rgba(255, 255, 255, 0.8);
    border-radius: 2rem;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), inset 0 4px 20px rgba(255, 255, 255, 0.2);
    width: 300px;
    height : 123px;
    overflow: hidden;
    display: inline-block;
    text-align: left;
}
.branch::after{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 2rem;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
    inset 0px -9px 0px -8px rgba(255, 255, 255, 0.5);
    opacity: 0.6;
    z-index: -1;
    filter: blur(1px) drop-shadow(10px 4px 6px black) brightness(115%);
    pointer-events: none;
}



.branch:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-bottom: 5px solid var(--borderbottom);
}
.branch i {
    color: var(--btncolor);
    position: absolute;
    top: 20px;
    right: 20px;
}
.branch:hover::before {
    transform: scaleX(1);
}

.branch h3 {
    color: var(--h2color);
    font-size: 1.2rem;
    font-weight: 700;
}

.branch p {
    display: block;
    font-size: 0.95rem;
    color: var(--parcolor);
    line-height: 1.5;
}

/* Footer */
footer {
    color: gray;
    padding: 40px 0 30px;
    margin-top: 50px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content {
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.footer-info {
    flex: 1;
    min-width: 250px;
}

.footer-info p {
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
    opacity: 0.9;
}


.social-links a {
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s;
    background-color: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: #fff;
    background-color: #0056b3;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.3);
}

/* Document List Styles */
.document-section {
    padding: 10px 0;
    overflow: auto;
    flex: 1;
}

.document-section h2 {
    color: var(--h2color);
    margin-bottom: 30px;
    text-align: center;
}

.info-box {
    position : relative;
    text-align: center;
}

.info-box p {
    color: var(--parcolor);
    font-size: 1rem;
    margin: 0;
}

.info-box i {
    color: var(--borderleft);
    margin-right: 10px;
}

.year-section {
    max-width: 60%;
    margin: 15px auto;
}
.year-navigation{
    display : block;
    margin: 20px auto;
    text-align: center;
}
.year-section h3 {
    background-color: var(--yearsection);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.semester-title {
    background-color: var(--semestersection);
    color: white;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 1.1rem;
    font-style: italic;
    font-weight: bold;
    cursor: pointer;

}
.semester-title:hover {
    background-color: #ff831d;
}
[data-theme="dark"] .semester-title:hover {
    background-color: #1B1A55;
}
summary {
    background-color: #0056b3;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 1.1rem;
    font-style: italic;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
summary:hover {
    background-color: #ff831d;
}

details {
    margin-bottom: 20px;
}
details[open] summary {
    margin-bottom: 10px;
}

details[open] > :not(summary) {
    animation: detailsOpen 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes detailsOpen {
    from {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}
.course-list {
    opacity: 1;
    transition: opacity 0.5s ease, max-height 0.8s ease;
    display: block;
    width : 100%;
}
details:not([open]) + .course-list,
details:not([open]) .course-list {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}
.course-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(1px) saturate(180%);
    border-radius: 1.4rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), inset 0 4px 20px rgba(255, 255, 255, 0.2);
    padding: 5px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    flex-grow: 1;
    border-top: 3px solid transparent;
    border-left: 3px solid transparent;
}
.course-card::after{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.4rem;
    backdrop-filter: blur(1px);
    box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1),
    inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
    opacity: 0.6;
    z-index: -1;
    filter: blur(1px) drop-shadow(10px 4px 6px black) brightness(115%);
    pointer-events: none;
}
.about-me{
    background-color: var(--card-bg);
    border-left: 4px solid var(--borderleft);
    padding: 15px 20px;

    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-width: 60%;
    margin: 20px auto;
}

.course-card:hover {
    border-top: 3px solid var(--bordercard);
}

.course-card.open {
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.15);
    border-left: 3px solid var(--borderleft);
}

.course-card h4 {
    color: var(--h4color);
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    padding: 16px;
}

.course-card h4::after {
    content: "+";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: bold;
}

.course-card.open h4::after {
    content: "-";
}
.document-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out;

}
.document-list p {
    margin : 0 15px;
    padding : 8px 0;
}

.course-card.open .document-list {
    max-height: 200px;
    overflow-y: auto;
    margin : 10px 0;
    opacity: 1;
    width: 100%;
}
.document-list::-webkit-scrollbar {
    width: 8px;

    background: transparent;
    border-radius: 8px;
}
.document-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff831d, white);
    border-radius: 8px;
    min-height: 40px;
}
[data-theme="dark"] .document-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #677db9, #bccfdb);
}
.document-list::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 8px;
}
.document-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin : 0 15px;
}

.document-item:last-child {
    border-bottom: none;
}

.document-item i {
    color: #e74c3c;
    margin-right: 10px;
}
.document-item a {
    color: var(--parcolor);
    transition: color 0.3s;
}

.document-item a:hover {
    color: var(--borderleft);
}
.carousel-container{
    align-items: center;
    justify-content: center;
    overflow : hidden;
    max-width : 60%;
    margin : 0 auto;
    padding : 20px 0;
    position: relative;
}
#prev-btn , #next-btn {
    border : none;
    color : var(--borderleft);
    cursor : pointer;
    font-size : 1rem;
    background-color: transparent;
    padding : 0 10px;
}
.carousel-nav {
    overflow : hidden;
    display : flex;
    width : 100%;
}
.carousel {
    display : flex;
    transition : transform 0.5s ease-in-out;
}
.slide {
    width: 100%;
    flex-shrink: 0;
    padding: 16px 8px;
    box-sizing: border-box;
    overflow: hidden;
}
.slide p{
    text-align: center;
    font-size: 1.1rem;
    color: var(--parcolor);
    line-height: 1.5;
    max-width: 90%;
    font-weight: 500;
    margin: 0 auto;
    word-break: break-word;
}
.music-player {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family : 'Segoe UI',sans-serif;
}
.player-container{
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 20px;
    padding : 20px 30px;
    width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow : visible;
}
.player-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center; /* Modifiez ici pour gérer la position (ex: top, left, right, bottom, center) */
    opacity: 0.2; /* Opacité faible */
    z-index: 0;
    border-radius: 20px;
    pointer-events: none;
}
.album-art{
    position : absolute;
    left : -60px;
    top : 0%;
    overflow: hidden;
}
.album-art img{
    width:120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}
.album-art::after {
    content:'';
    position: absolute;
    margin-top: 60px;
    left : 50%;
    width : 20px;
    height : 20px;
    background: rgba(255, 255, 255, 0.8);  /* center color */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4);
}
@keyframes rotation {
    0%{transform : rotate(-360deg)}
    100%{transform : rotate(0deg)}
}
.trackinfo{
    margin-left : 60px;
    font-size: 1.1rem;
}
.trackinfo p {
    margin: 5px 0;
    padding-bottom: 10px;
    color: var(--parcolor);
}
.progress-bar{
    width : 70%;
    height : 5px;
    border-radius: 5px;
    border : 1px solid var(--borderleft);
    overflow: hidden;
    position: absolute;
    cursor: pointer;

}
.progress {
    width: 0;
    height: 100%;
    background: var(--borderleft);
    transition: width 0.2s ease;
}
.controls {
    display: flex;
    align-items: center;
    margin-left : 10px;
    gap: 10px;
}
.controls .btn {
    border : none;
    box-shadow : none;
    padding : 0;
    margin : 0;
    font-size : 1.3rem;
    cursor: pointer;
    transition : transform 0.3s ease;
}

@media(max-width: 1000px){
    .logo p {
        display: none;
    }
}
/* Responsive Styles */
@media (max-width: 1000px) {
    .course-card,
    .course-card::after {
        position: relative;
    }

    header {
        width: 90%
    }
    .carousel-container{
        max-width: 60%;
    }
    .slide {
        padding: 10px 4px;;
    }
    .slide p {
        font-size: 0.9rem;
        max-width: 80%;
    }

    .menu-toggle {
        display: block;
    }

    .year-section{
        max-width: 100%;
    }

    .year-navigation {
        display : grid;
        padding : 0 30px;
    }

    .logo p {
        display: none;
    }

    .info-box , .about-me {
        max-width: 100%;
        margin: 20px auto;
    }
    nav {
        position: absolute;
        display: flex;
        background-color: var(--header-bg);
        border-radius: .75rem;
        min-width: 220px;
        width : 20vw;
        right : 20px;
        top: 60px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        align-items : flex-start;
        padding : 18px 0 18px 18px;
        gap : 0;
        transform : translateY(-400px) scale(0.98);
        text-align: left;
        opacity: 0;
        transition : transform 0.4s ease-in-out, opacity 0.3s ease-in-out;

    }
    nav a {
        font-size: 0.95rem;
        padding : 5px;
    }

    nav.active {
        opacity: 1;
        transform : translateY(0) scale(1);
        transition: opacity 0.3s ease;
    }


    .hero h2 {
        font-size: 2rem;
    }

    .branches {
        flex-direction: column;
        align-items: center;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }
    .player-container {
        flex-direction: column;
        align-items: center;
        max-width: 500px;
        margin : 0 auto;
        width : 75%;
    }
    .album-art {
        position: relative;
        left : 0;
        top : -30px;
    }
    .album-art img {
        width: 100px;
        height: 100px;
        margin-bottom: 0;
    }
    .album-art::after{
        width: 15px;
        height: 15px;
        margin-top: 50px;
    }

    .controls {
        justify-content: center;
        gap: 5px;
        margin : 10px 20px 10px;
    }
    .controls .btn {
        font-size: 1.3rem;
    }
    .trackinfo {
        margin-left: 0;
        margin-top: 0;
        margin-bottom: 20px;
        text-align: center;
    }
    .progress-bar {
        position : absolute;
        width: 60%;
        height: 5px;
        left: 50%;
        bottom: 80px;
        transform: translateX(-50%);

    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.5rem;
    }
    .carousel-container {
        max-width: 95%;
        margin : 0 20px;
    }
    .slide {
        padding: 10px 4px;
    }
    .slide p {
        font-size: 0.85rem;
        max-width: 70%;
        line-height: 1.4;
    }
}
@media (min-width:1024px) {
    header {
        max-width: 1200px;
    }
    .container{
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
}

