/* Style the base of the website */
* {
    padding: 0;
    margin: 0;
}

body {
    background: var(--website-background);
    color: var(--primary-color);
    font-family: var(--font-family-main);
    animation: fade-in 1.5s ease-in-out;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 2.8rem;
    /* Disables selecting */
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
}

/* Website Light Mode */
.whitemode-toggle {
    position: fixed;
    right: 0.5rem;
    top: 0.5rem;
    color: var(--primary-color);
    font-size: 25px;
}

/* Compact white-mode overrides. Most elements inside .whitemode become darker text
   and lose shadows; a few elements keep white color for contrast (toggle icon, header,
   down arrow and popup contents). */
.whitemode {
    background: var(--whitemode-bg-color);
}
.whitemode * {
    color: var(--whitemode-text-color_dark);
    text-shadow: none;
    box-shadow: none; /* remove box shadows in white mode */
}
.whitemode .contact-form > *,
.whitemode .container .button,
.whitemode .submit-button {
    box-shadow: none;
}
.whitemode .container .button,
.whitemode .submit-button,
.whitemode footer {
    background: var(--whitemode-accent-color);
    color: var(--whitemode-text-color);
}
.whitemode #links a {
    color: var(--whitemode-text-color);
}
.whitemode footer a, .whitemode footer span, .whitemode footer .lastupdate::before {
    color: var(--whitemode-text-color);
}
/* Exceptions that should remain white for contrast */
.whitemode .whitemode-toggle i,
.whitemode .header-text,
.whitemode .downarrow i,
.whitemode .popup * {
    color: var(--whitemode-text-color);
}

/* Ensure no shadows or filters remain on container headers/icons in white mode */
.whitemode .container h1,
.whitemode .container i,
.whitemode .container * {
    text-shadow: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Keep the header H1's text-shadow in white mode for contrast */
.whitemode .header-text,
.whitemode .header-text a {
    text-shadow: 5px 5px 10px rgba(0,0,0,0.7) !important;
}

/* Remove element filters (drop-shadow) for specific items when in white mode */
.whitemode .nav-game,
.whitemode .header-container {
    filter: none;
}

.whitemode .radio {
    filter: none;
    color: var(--whitemode-text-color);
    background: var(--whitemode-accent-color);
    border: none;
}

.whitemode .metadata #artist,
.whitemode .metadata #nowPlaying,
.whitemode .buttons, 
.whitemode .radio h1, 
.whitemode .radio h3 {
    color: var(--whitemode-text-color);
}

/* Popup styling */
.popup {
    background: var(--popup-background);
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    width: max-content;
}
.popup h1 {
    font-size: 1.25rem;
}
.hidden {
    transition: opacity 2s ease-in-out;
    opacity: 0;
}

/* visually hidden for accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* hidden field for honeypot (kept in DOM for bots) */
.hidden-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.lastupdate::before {
    content: "🔃 Website last updated: " var(--site-last-updated);
    display: inline-block;
}

/* Style the navbar */
.navbar {
    position: fixed;
    top: 10px;
    left: 50%;                  /* center horizontally */
    transform: translateX(-50%);
    background: var(--navbar-background);
    width: 60%;
    max-width: 1000px;
    padding: 10px;
    z-index: 1;
    display: flex;
    align-items: center;        /* vertical centering of content */
    justify-content: center;    /* center the inner .navbar-links */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin: 5px auto;
}
.navbar-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 10px;
}

a:hover {
    text-decoration: var(--text-decoration);
    text-underline-offset: var(--underline-offset);
    text-decoration-thickness: var(--underline-thickness);
}
.navbar-links {
    display: flex;
    justify-content: center; /* center links horizontally inside the navbar */
    align-items: center;     /* vertically center link items */
    gap: 12px;               /* small spacing between links */
    width: 100%;
}

.nav-game {
    filter: drop-shadow(0px 0px 5px black);
    animation: zoom 1s infinite;
    color: var(--navbar-game-color) !important;  /* Added !important to override other styles */
}

@keyframes zoom {
    0%{
        transform: scale(1.0);
    }
    50%{
        transform: scale(1.1);
    }
    100%{
        transform: scale(1.0);
    }
}

/* Style the responsive navbar */
.menu-button {
    display: none;
    flex-direction: column;
    cursor: pointer;
}
.menu-button .bar {
    width: 32px;
    height: 5px;
    border-radius: 5px;
    background: var(--primary-color);
    margin: 3px 0px;
}
/* Define when the mobile navbar is shown */
@media screen and (max-width: 500px) {
    .menu-button {
        display: flex;
    }
    .navbar-links {
        display: none;
        width: 100%;
        flex-direction: column;
    }
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        height: max-content;
    }
    .navbar-links a {
        text-align: center;
        padding: 3px 0px;
    }
    .navbar-links.clicked {
        display: flex;
    }
}

/* Style the header with a parallax effect */
/* .header {
    background-image: url("https://static.joni8829.com/images/JoniWebsite_Banner.jpg");
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    max-height: 100vh;
} */

.header::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-image: url("https://static.joni8829.com/images/JoniWebsite_NewBanner.jpg");
    background-size: cover;
    background-position: center;
    max-height: 100vh;
    filter: blur(2px) brightness(0.9);
    z-index: -1;
}

.header-text {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12rem;
    display: inline-block;
}
.header-container {
    max-height: 100vh;
    text-align: center;
    display: flex;
    justify-content: center;
    height: 100vh;
    align-items: center;
    flex-direction: column;
    font-size: 6.25rem;
    filter: drop-shadow(5px 5px 10px black); /* restore drop-shadow */
}
.downarrow {
    position: absolute;
    bottom: 20px;
    font-size: 2.8rem;
}
.downarrow > a {
    color: white;
}

.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: var(--typewriter-cursor-width) solid white;

    /* typing animation (per-character steps), blinking cursor, and hide-cursor at end */
    animation: typing var(--typewriter-duration) steps(var(--typewriter-steps)) forwards,
               blink 0.6s step-end infinite,
               hideCursor 0.01s linear var(--typewriter-duration) forwards;
}

@keyframes typing {
    from { width: 0; }
    to { width: var(--typewriter-width); }
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

@keyframes hideCursor {
    to { border-right-width: 0; }
}

/* Style the container */
.container {
    margin: 10px auto;
    width: 50%;
    display: flex;
    align-items: center;
    margin-top: 100px;
    margin-bottom: 100px;
}
.container h1 {
    text-shadow: 5px 5px 10px black;
    margin-bottom: 10px;
}
.container i {
    font-size: 6.25rem;
    text-shadow: 5px 5px 10px black;
    margin: 0px 50px;
}
.container-text {
    width: 100%;
    letter-spacing: 1px;
}

#lastfm {
    margin-top: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-radius: 12px;
    width: 100%;
}

.email-link a {
    color: var(--primary-color);
    text-decoration: underline;
    background: var(--border-color);
    padding: 10px 10px;
    border-radius: 5px;
    display: inline-block;
    margin: 10px 0px;
}

.email-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.email-link a:hover {
    transform: scale(1.05);
}

/* Style the toggle text */
.portfolio summary {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 10px;
    list-style: none;
}

/* Style the up arrow */
.uparrow {
    position: fixed;
    right: 15px;
    bottom: 15px;
    color: var(--primary-color);
    margin: 10px 5px;
    font-size: 2.5rem;
    opacity: 0;
}
.scrolled {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Style the social icons */
.social-icons {
    display: flex;
}

/* Style the footer section */
footer {
    text-align: center;
    white-space: pre-wrap;
    background: var(--footer-background);
}
footer a {
    color: var(--primary-color);
}
.footer-img {
    width: 100px;
    border-radius: 100%;
}
.footer-icons {
    display: flex;
    justify-content: center;
    margin-top: -35px;
    color: var(--footer-icon-color);
}
.footer-icons > a {
    margin-left: 5px;
}
.footer-icons > a i {
    font-size: 1.25rem;
    color: var(--footer-icon-color);
}
.footer-icons a i:hover {
    transform: scale(1.2);
    transition: 1s;
}
.footer-links {
    display: flex;
    justify-content: center;
}

/* Style the buttons */
.button {
    background: var(--button-color);
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    display: block;
    color: white;
    box-shadow: 5px 5px 10px black;
}
.button:hover {
    background: var(--button-hover-color);
    transition: 1s;
    transform: scale(1.01);
}

/* Style the contact form */
.contact-form {
    display: flex;
    flex-direction: column;
}
.contact-form > input[type=text]:focus, input[type=email]:focus, textarea:focus {
    outline: none;
    border: 1.5px solid var(--accent-color);
    background: var(--contact-form-background);
    color: white;
}
.contact-form > *:focus::placeholder {
    color: var(--primary-color);
}
.contact-form > *::placeholder {
    color: var(--contact-form-text-color);    
}
.contact-form > input, textarea {
    border: none;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 5px 5px 10px black;
}
.contact-form textarea {
    resize: none;
    font-family: sans-serif;
}

.successmsg {
    color: white;
    margin-top: 10px;
    text-align: center;
    display: block;
    padding: 10px;
    border-radius: 20px
}

/* Style the submit button */
.submit-button {
    border: none;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    background: var(--button-color);
    color: var(--primary-color);
    box-shadow: 5px 5px 5px black;
    text-shadow: 5px 5px 5px black;
}
.submit-button:hover {
    background: #7a7a7a;
    transition: 1s;
}

/* Make the website responsive */
@media (max-width: 800px) {
    .container {
        flex-direction: column;
    }
    .uparrow {
        padding: 5px;
    }
    .uparrow img {
        width: 30px;
        left: 20px;
        bottom: 20px;
    }
    .header-text {
        font-size: 6.25rem;
        letter-spacing: 1px;
    }
    .container-text {
        margin-top: 10px;
        text-align: center;
    }
    .container {
        max-width: 75%;
    }
    .navbar-links a:hover {
        margin: 0 auto;
    }
    footer {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    .footer-img {
        width: 50px;
    }
    .footer-links {
        font-size: 1rem;
    }
    .footer-icons a img {
        width: 15px;
    }
    .footer-icons {
        margin-top: -20px;
    }
    .popup {
        width: 35%;
    }
    .container i {
        margin: 0px;
    }
}

@media (max-width: 330px) {
    .header-text {
        font-size: 75px;
    }
}

/* Create the fade in animation */
@keyframes fade-in {
    0%{
        opacity: 0;
    }
    100%{
        opacity: 1;
    }
}