/* Theming */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap");

@font-face {
    font-family: 'WinxScript';
    src: url('Winx Script.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --white: #F1dad1;
    --black: #c0f4b7;
    --grey: #85888C;
}

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

body {
    background-color: #F1dad1;
    font-family: "Poppins", sans-serif;
}

/* Header */
.header {
    background-color: #c0f4b7;
    background-image: url(winxaura.jpg), linear-gradient(to right, #c0f4b7 50%, transparent 50%);
    background-size: 50% 100%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 1px 1px 5px 0px var(--grey);
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    z-index: 10;
    overflow: visible;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    color: #FFFFFF;
    font-family: "WinxScript", sans-serif;
    font-size: 60px;
    margin-left: 10px;
    text-decoration: none;
}

/* Nav menu */
.nav {
    background-color: transparent;
    overflow: visible;
    display: flex;
    align-items: center;
}

/* Hide menu by default on small screens */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    transition: max-height 0.3s ease; /* Smooth open/close effect */
}

/* Menu links */
.menu li {
    position: relative;
    display: inline-block;
    margin-right: 20px;
}

.menu a {
    text-decoration: none;
    padding: 10px 20px;
    display: block;
    background-color: #c0f4b7;
    color: #ffffff;
    font-family: "Poppins", sans-serif;
}

.menu a:hover {
    background-color: #dab9ef;
}

/* Dropdown Menu */
.menu li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #c0f4b7;
    padding: 0;
    list-style: none;
    z-index: 20;
    min-width: 200px;
    font-size: smaller;
}

.menu li ul li {
    width: 200px;
}

.menu li ul li a {
    padding: 10px;
    background-color: #c0f4b7;
    color: #ffffff;
}

.menu li ul li a:hover {
    background-color: #dab9ef;
}

/* Show submenu on hover */
.menu li:hover > ul {
    display: block;
    z-index: 20;
}

/* Nested submenu */
.menu li ul li ul {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #c0f4b7;
}

.menu li ul li:hover > ul {
    display: block;
}
/* Hamburger Menu Icon */
.hamb {
    cursor: pointer;
    float: right;
    padding: 40px 20px;
    display: none; /* Hidden on larger screens */
}

.hamb-line {
    background: #FFFFFF;
    display: block;
    height: 2px;
    position: relative;
    width: 24px;
    transition: background 0.2s ease-out; /* Smooth transition for line color */
}

.hamb-line::before,
.hamb-line::after {
    background: #FFFFFF;
    content: '';
    display: block;
    height: 100%;
    position: absolute;
    width: 100%;
    transition: transform 0.2s ease-out, top 0.2s ease-out; /* Smooth rotation transition */
}

.hamb-line::before {
    top: 5px;
}

.hamb-line::after {
    top: -5px;
}

/* Hide checkbox */
input[type="checkbox"].side-menu {
    display: none;
}

/* Toggle menu visibility and animate hamburger icon on click */
.side-menu:checked ~ .nav {
    max-height: 500px; /* Set max height to enable smooth dropdown */
    transition: max-height 0.5s ease-out;
}

.side-menu:checked ~ .hamb .hamb-line {
    background: transparent;
}

.side-menu:checked ~ .hamb .hamb-line::before {
    transform: rotate(-45deg);
    top: 0;
}

.side-menu:checked ~ .hamb .hamb-line::after {
    transform: rotate(45deg);
    top: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    /* Show hamburger menu on small screens */
    .hamb {
        display: block;
        z-index: 20; /* Ensure hamburger icon is above the other content */
    }

    /* Hide menu by default on small screens */
    .menu {
        display: flex;
        flex-direction: column;
        position: fixed; /* Fixed to ensure it covers the entire screen when shown */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; 
        max-height: 0; /* Hide initially */
        overflow: hidden; /* Hide any content overflow */
        visibility: hidden; /* Make the menu invisible initially */
        transition: max-height 0.5s ease-out, visibility 0s linear 0.5s; /* Transition visibility */
        background-color: var(--black);
        z-index: 40; /* Ensure menu is above content but below the hamburger icon */
        padding-top: 60px; 

    }

    /* Show menu when side-menu checkbox is checked */
    .side-menu:checked ~ .nav .menu {
        max-height: 100vh; /* Full expand to screen height */
        visibility: visible; /* Make menu visible */
        transition: max-height 0.5s ease-out, visibility 0s linear 0s; /* Ensure visibility change is immediate */
    }

    /* Menu item styles */
    .menu li {
        width: 100%;
        text-align: center;
        margin: 15px 0;
        font-stretch: expanded;
    }

    .menu a {
        padding: 20px;
        display: block;
        color: #ffffff;
        text-decoration: none;
        font-size: 1.5em;
    }

    .menu a:hover {
        background-color: #dab9ef;
    }

    .nav {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        background-color: transparent; /* Keep background transparent initially */
        z-index: 10;
    }
}

/* Fullscreen Menu Styles for the Hamburger Menu */
.side-menu:checked ~ .nav .menu {
    background-color: var(--black); 
}

/* Desktop Styles (Greater than 768px) */
@media (min-width: 768px) {
    /* Hide hamburger icon */
    .hamb {
        display: none;
    }

    .nav {
        max-height: none;
        position: static;
        width: fit-content;
        background-color: transparent;
    }

    .menu {
        display: flex;
        flex-direction: row;
        position: static;
        max-height: none;
        padding: 0;
        visibility: visible; /* Ensure visible on desktop */
        background-color: transparent;
    }

    .menu li {
        margin-right: 20px;
    }

    .character-name {
        font-family: 'WinxScript', 'Poppins', sans-serif; 
        font-size: 36px;
        color: #7e6f85; 
        text-align: center; 
        margin: 20px 0;
    }
    
}
