/* Base Styles and Resets */
:root {
    --text-color: #333333;
    --box-bg: rgba(230, 230, 230, 0.9);
    /* Grayish translucent box from mockup */
    --nav-link-color: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    color: var(--text-color);
    background-color: #0b071a;
    /* Backup dark background */
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Image Responsive Handling */
.page-wrapper {
    min-height: 100vh;
    width: 100%;
    /* Default to Mobile Background */
    background-image: url('../images/Mobile_background_image.jpg');
    background-size: 130% auto;
    background-position: top center;
    background-repeat: no-repeat;
    background-color: #04020a;
    /* Dark seamless background matching the bottom */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Desktop Background Query */
@media (min-width: 768px) {
    .page-wrapper {
        background-image: url('../images/Desktop_background_image.jpg');
        background-size: 100% auto;
    }
}

/* Canvas Positioning */
#fireflies {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    /* Behind content, above background */
    pointer-events: none;
    /* Let clicks pass through to content */
}

.z-index-top {
    z-index: 1030;
    /* Bootstrap fixed navbar base is 1030, ensures it is always on top of page content */
    /* Content above fireflies */
}

/* Navigation Styles */
.nav-link {
    color: var(--nav-link-color);
    transition: color 0.3s ease;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.nav-tabcolor {
	color: rgba(55,55,55,1.00);
}

.nav-link:hover,
.nav-link:focus {
    color: #ffd700;
    /* Subtle hover effect */
}
.nav-tabcolor:hover,
.nav-link:focus {
	color: rgba(0,0,0,1.00);
}
/* Mobile Menu Background */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: rgba(4, 2, 10, 0.92);
        /* Dark background matching the theme */
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 10px 20px;
        margin-top: 15px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    .navbar-collapse .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-collapse .nav-item:last-child .nav-link {
        border-bottom: none;
    }
}

/* Navigation Scrolled State */
#mainNav {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

#mainNav.scrolled {
    background-color: rgba(4, 2, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    z-index: 1040;
    /* Ensure scrolled state is also firmly on top */
}

/* Back to Top Transition */
.transition-all {
    transition: all 0.3s ease;
}

/* Content Box Styles */
.content-margin-top {
    margin-top: 75vw;
    /* Push content below the image on mobile */
}

@media (min-width: 768px) {
    .content-margin-top {
        margin-top: 28vw;
        /* Push content below the image on desktop */
    }
}

.content-box {
    background-color: var(--box-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    min-height: 400px;
    /* To match the long look in mockup */
    border-radius: 20px;
}

.content-container {
    flex-grow: 1;
    /* Pushes footer to bottom */
}

/* Fix Tailwind visibility:collapse conflict with Bootstrap navbar */
.navbar-collapse.collapse {
    visibility: visible !important;
}

/* Footer Styles */
.footer {
    background-color: #07060f;
    /* Dark footer as in mockup */
    width: 100%;
}