/* --- Header Styles --- */
.mega-header {
    width: 100vw;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-bottom: 2px solid #c8a2c8;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
    transition: height 0.4s ease, padding 0.4s ease, background-color 0.3s ease;
    height: auto; /* Default height */
}
.header-animation-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.header-symbol {
    position: absolute;
    color: #e0c6e0;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    text-shadow: 0 0 8px rgba(200, 162, 200, 0.7);
    font-size: 18px;
}
.mega-header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.header-col h4 {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    color: #8a2be2;
    font-weight: 500;
    transition: color 0.3s ease;
}
.header-col ul { list-style: none; padding: 0; margin: 0; }
.header-col li { margin-bottom: 0.5rem; }
.header-col a {
    text-decoration: none;
    color: #4d465a;
    font-weight: normal;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}
.header-col a:hover { color: #8a2be2; }


/* --- Control Bar Styles --- */
.header-controls {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 2;
    display: flex;
    gap: 8px;
}
.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s, transform 0.2s;
}
.control-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}


/* --- Feature Styles --- */

/* 1. Minimized State */
.mega-header.minimized {
    height: 52px; /* Set a fixed small height */
    border-bottom: 2px solid #c8a2c8;
}
.mega-header.minimized .mega-header-inner {
    opacity: 0;
    visibility: hidden; /* Hide the content completely */
}

/* 2. Dark Mode State */
body.dark-mode {
    filter: invert(1) hue-rotate(180deg);
    background: #fff; /* Inverting black gives white, so start from white */
}
/* Double-invert images, videos, and the footer to make them look normal */
body.dark-mode img,
body.dark-mode video,
body.dark-mode .mega-footer {
    filter: invert(1) hue-rotate(180deg);
}


/* 3. Rainbow Mode State */
@keyframes rainbow-text-scroll {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes rainbow-text-animation {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* This class targets the symbols to make them rainbow colored and brighter */
.rainbow-mode .header-symbol {
    color: #ff7b7b; /* Start color for the animation */
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9); /* Brighter glow */
    animation: rainbow-text-animation 3s linear infinite;
}

/* This class targets page headings to make them rainbow */
body.rainbow-headings h1,
body.rainbow-headings h2,
body.rainbow-headings .header-col h4 {
    background: linear-gradient(to right, #ff7b7b, #ffdd7b, #b5ff7b, #7bffb5, #7bffff, #7b7bff, #b57bff, #ff7bb5, #ff7b7b);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text-scroll 4s linear infinite;
}

/* Add this new rule to make the logo image rainbow */
body.rainbow-headings .seal-image {
    animation: rainbow-text-animation 3s linear infinite;
}

