/* 🌙 Default Variables for Light/Dark Mode */
:root {
    --bg-color: white;
    --text-color: black;
    --header-bg: rgba(0, 0, 0, 0.5);
    --footer-bg: rgba(0, 0, 0, 0.8);
    --product-bg: rgba(0, 0, 0, 0.1);
    --lighthouse-light: yellow;
    --beam-opacity: 0; /* Invisible beam in Light Mode */
}

/* 🌚 Dark Mode */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: white;
    --header-bg: rgba(0, 0, 0, 0.8);
    --footer-bg: rgba(0, 0, 0, 0.9);
    --product-bg: rgba(255, 255, 255, 0.1);
    --lighthouse-light: yellow;
    --beam-opacity: 0.8; /* Beam visible in Dark Mode */
}

/* Apply Theme */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 150px;
    background: var(--header-bg);
    transition: height 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Full-width SVG Background */
#header-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

/* Ensure SVG Fills the Header */
#header-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Small Lighthouse Logo (Always Left) */
.small-logo {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    transition: height 0.3s ease, width 0.3s ease;
}

/* Lighthouse Logo Scales with Header */
#header-logo {
    height: 150px; /* Default to match full header */
    width: auto; /* Maintain aspect ratio */
    transition: height 0.3s ease;
}

/* Shrinking Header on Scroll */
.shrink {
    height: 50px;
    background: var(--footer-bg);
}

/* Shrinking Logo on Scroll */
.shrink #header-logo {
    height: 50px; /* Shrinks along with the header */
}

/* Hide SVG When Scrolling */
.shrink #header-svg-container {
    opacity: 0;
}

/* Main Content */
main {
    text-align: center;
    margin-top: 160px; /* Ensures content is below header */
    flex: 1;
}

main #content {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    width: 70%;
}

/* Product List */
.product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding-bottom: 80px; /* Prevent overlap with footer */
}

/* Product Cards */
.product {
    background: var(--product-bg);
    padding: 10px;
    border-radius: 10px;
    width: 150px;
    text-align: center;
    transition: background 0.3s ease;
}

.product img {
    width: 100%;
    border-radius: 5px;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 10px;
    transition: background 0.3s ease;
    display: flex; justify-content: space-evenly; align-items: center;
}

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 5px;
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] #theme-toggle {
    background: white;
    color: black;
}

/* Lighthouse Beam (Hidden in Light Mode, Visible in Dark Mode) */
#lighthouse-beam {
    position: absolute;
    top: -30px;
    left: 50%;
    width: 100px;
    height: 50px;
    transform: translateX(-50%);
    background: radial-gradient(rgba(255, 255, 0, var(--beam-opacity)), transparent);
    opacity: var(--beam-opacity);
    transition: opacity 0.3s ease;
}
