/* styles/header.css */

header {
    background: linear-gradient(90deg, #541767 0%, #022253 100%);
    color: #fff;
    padding: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
    flex-wrap: wrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

header .logo {
    display: flex;
    align-items: center;
    margin-right: 1em; /* Space between logo and title */
}

header .logo img {
    width: 150px;
    height: 150px;
    border-radius: 7%;
    transition: transform 0.3s ease;
}

header .logo img:hover {
    transform: scale(1.05);
}

header h1 {
    font-family: 'Comic Neue', cursive;
    margin: 0;
    font-size: 2.5em;
    color: #ff9d00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    position: relative;
    animation: fadeInDown 1s ease-out forwards;
    cursor: pointer;
    flex: 1; /* Allows it to take available space */
    text-align: center; /* Centers text within its space */
}

.nolink {
    color: #ff9d00 !important;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    -moz-text-decoration: none !important;
    text-decoration-line: none !important;
    display: block;
}

header h1 a:link,
header h1 a:visited,
header h1 a:hover,
header h1 a:active,
header h1 a:focus {
    text-decoration: none !important;
    color: #ff9d00 !important;
    outline: none;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff9d00;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

header h1:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

header nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Aligns nav to the right */
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5em;
}

header nav ul li {
    margin: 0;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

header nav ul li a:hover {
    background-color: rgba(255, 157, 0, 0.2);
    color: #ff9d00;
    transform: translateY(-2px);
}

header nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff9d00;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

header nav ul li a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Active state for the current page */
header nav ul li.active a {
    background-color: #ff9d00;
    color: #121212;
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(255, 157, 0, 0.5);
}

header nav ul li.active a:hover {
    background-color: #e68c00; /* Slightly darker on hover */
    color: #121212;
}

header nav ul li.active a::after {
    transform: scaleX(0); /* Disable the underline effect for active state */
}

/* Responsive Adjustments for Header */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
    }

    header .logo {
        margin-right: 0; /* Remove margin on smaller screens */
        margin-bottom: 0.5em; /* Add spacing below logo */
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 0.5em; /* Space between title and nav */
    }

    header nav {
        align-items: center;
    }

    header nav ul {
        flex-direction: column;
    }

    header nav ul li a {
        padding: 6px 12px;
        font-size: 1em;
    }
}