@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic&display=swap');

/* Primary CSS */ 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Nanum Gothic", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}

#protected-content-wrapper {
    display: none; /* Hide the content block by default */
}

.main-container {
    width: 100%; /* Keeps full width behavior when needed */
    max-width: 100%;
    padding: 0 10px; /* Adds space on the sides for very small screens */
    box-sizing: border-box;
    margin: 25px auto; /* center by default */
}

body {
    /* Use normal document flow so header/wrapper/content stack vertically */
    display: block;
    margin-top: 125px;
    margin-bottom: 125px;
    min-height: 100vh;
    background: url('Vakaroria_Banner.png') no-repeat;
    background-size: cover;
    background-position: center;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 99;
}

.logo {
    padding-right: 6px;
    padding-left: 3px;
    background: transparent;
    border: 5px solid #6dcaff;
    border-style: groove;
    border-radius: 6px;
    box-shadow: 0 0 15px #00ffc8;
    backdrop-filter: blur(20px);
    font-size: 48px;
    color: #56ff67;
    user-select: none;
}

.navigation a {
    position: static;
    font-size: 1.1em;
    color: #56ff67;
    text-decoration: none;
    font-weight: 500;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 10px;
    margin-right: 10px;
    padding-top: 3px;
    padding-bottom: 4px;
    padding-left: 5px;
    padding-right: 5px;
    background: transparent;
    border: 2.5px solid #6dcaff;
    border-style: groove;
    border-radius: 3px;
    box-shadow: 0 0 10px #00ffc8;
    backdrop-filter: blur(20px);
}

.navigation a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 3px;
    background: transparent;
    border: 2.5px solid #b463ff;
    border-style: groove;
    border-radius: 3px;
    box-shadow: 0 0 10px #56ff67;
    backdrop-filter: blur(20px);
    transform-origin: right;
    transform: scaleX(0);
    transition: transform .5s;
}

.navigation a:hover::after {
    transform-origin: left;
    transform: scaleX(1);
}

/* Default desktop styles (applied in +layout.svelte <style> or app.css) */
.nav-links {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    justify-content: space-between;
}

/* Mobile Overrides (Triggered on screens 600px wide or smaller) */
@media (max-width: 600px) {
    .nav-links {
        flex-direction: column; /* Vertical stacking */
        align-items: stretch;   /* Make buttons full width */
        padding: 0;
    }
    
    .nav-links a {
        display: block; /* Make each link take up the full width */
        text-align: center;
        margin-bottom: 5px;
    }
}

/* Center main content with ~125px side margins on wide viewports */
@media (min-width: 1000px) {
    .main-container {
        max-width: calc(100% - 250px); /* leaves ~125px on each side */
        margin: 0 auto;
    }
}

/* Reduce side margins on medium and small screens */
@media (max-width: 999px) {
    .main-container {
        max-width: calc(100% - 40px);
        margin: 0 20px;
    }
}

/* Welcome Page CSS */
.navigation .btnLogin-popup {
    width: 130px;
    height: 50px;
    background: #00028a;
    border: 2px solid #7a7dff;
    border-style: groove;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    color: #00ffc8;
    font-weight: 500;
    margin-left: 20px;
    transition: .5s;
}

.navigation .btnLogin-popup:hover {
    border: 2px solid #7a7dff;
    border-style: groove;
    background: #020e4f;
    color: #6dcaff;
}

.wrapper {
    /* Make the popup overlayed so it doesn't affect document flow */
    position: absolute;
    left: 50%;
    top: 140px; /* place below the header; adjust if header height changes */
    width: auto;
    max-width: 400px; /* keeps the intended size on larger screens */
    height: 440px;
    background: transparent;
    border: 4px solid #7a7dff;
    border-style: groove;
    border-radius: 4px;
    box-shadow: 0 0 10px #b463ff;
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transform: translateX(-50%) scale(0);
    transition: transform .5s ease, height .2s ease;
    z-index: 100; /* keep above content */
}

.wrapper.active-popup {
    transform: translateX(-50%) scale(1);
}

.wrapper.active {
    height: 520px;
}

.wrapper .form-box {
    width: 100%;
    padding: 40px;
}

.wrapper .form-box.login {
    transition: transform .18s ease;
    transform: translateX(0);
}

.wrapper.active .form-box.login {
    transition: none;
    transform: translateX(-400px);
}

.wrapper .form-box.register {
    position: absolute;
    transition: none;
    transform: translateX(400px);
}

.wrapper.active .form-box.register {
    transition: transform .18s ease;
    transform: translateX(0);
}

.wrapper .icon-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 45px;
    height: 45px;
    background: #020e4f;
    font-size: 2em;
    color: #00ffc8;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-left-radius: 20px;
    cursor: pointer;
    z-index: 1;
}

.wrapper .icon-close:hover {
    border: #00ffc8;
    background: #020e4f;
    color: #6dcaff;
}

.form-box h2 {
    font-size: 2em;
    color: #56ff67;
    text-align: center;
}

.input-box {
    position: relative;
    width: 100%;
    height: 50px;
    border-bottom: 2px solid #7a7dff;
    margin: 30px 0;
}

.input-box label {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    font-size: 1em;
    color: #6dcaff;
    font-weight: 500;
    pointer-events: none;
    transition: .5s;
}

.input-box input:focus~label,
.input-box input:valid~label {
    top: -5px;
}

.input-box input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1em;
    color: #6dcaff;
    font-weight: 600;
    padding: 0 35px 0 5px;
}

.input-box .icon {
    position: absolute;
    right: 8px;
    font-size: 1.2em;
    color: #6dcaff;
    line-height: 57px;
}

.remember-forgot {
    font-size: .9em;
    color: #6dcaff;
    font-weight: 500;
    margin: -15px 0 15px;
    display: flex;
    justify-content: space-between;
}

.remember-forgot label input {
    accent-color: #6dcaff;
    margin-right: 3px;
}

.remember-forgot a {
    color: #6dcaff;
    text-decoration: none;
}

.remember-forgot a:hover {
    text-decoration: underline;
}

.btn {
    width: 100%;
    height: 45px;
    background: #020e4f;
    border: none;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    color: #6dcaff;
    font-weight: 500;
}

.login-register {
    font-size: .9em;
    color: #6dcaff;
    text-align: center;
    font-weight: 500;
    margin: 25px 0 10px;
}

.login-register p a {
    color: #6dcaff;
    text-decoration: none;
    font-weight: 600;
}

.login-register p a:hover {
    text-decoration: underline;
}

.content {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 0 15px 5px 15px;
    margin: 0 auto;
    overflow: hidden;
    background: #00028a;
    border: 4px solid #7a7dff;
    border-style: groove;
    border-radius: 10px;
    box-shadow: 0 0 10px #b463ff;
}

.content h3 {
    text-align: center;
    line-height: 25px;
    margin-top: 25px;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bolder;
    color: #00ffc8;
}

p {
    padding-top: 0;
    padding-bottom: 15px;
    padding-left: 15px;
    padding-right: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 5px;
    margin-right: 5px;
    font-family: "Nanum Gothic", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    background: #020e4f;
    border: 2px solid #7a7dff;
    border-style: groove;
    border-radius: 6px;
    box-shadow: 0 0 10px #b463ff;
    text-align: center;
    line-height: 25px;
    font-weight: medium;
    color: #6dcaff;
}

.link {
    position: relative;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    padding-right: 0px;
    margin-top: 0px;
    margin-bottom: 20px;
    margin-left: 50px;
    margin-right: 0px;
    display: flex;
    font-size: 1.1em;
    text-align: center;
    font-weight: 500;
    margin: 50px 20px;
    color: #020e4f;
}

/* Center content with ~125px side gutters on wide screens */
@media (min-width: 1000px) {
    .content {
        /* Use a fixed max-width for predictable centering */
        max-width: 1000px;
        margin: 0 auto 100px auto; /* center horizontally */
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Medium and small screens: keep comfortable gutters */
@media (max-width: 999px) {
    .content {
        max-width: calc(100% - 40px);
        margin: 0 20px 100px 20px;
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Make large images responsive inside content */
.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.link .icon {
    position: absolute;
    right: 8px;
    color: #b463ff;
    line-height: 25px;
}

.link a {
    position: relative;
    padding-top: 0px;
    padding-bottom: 50px;
    padding-left: 0px;
    padding-right: 150px;
    color: #6dcaff;
    text-decoration: none;
    font-weight: 600;
}

.link a:hover {
    text-decoration: underline;
    color: #7a7dff;
}

/* Add a responsive breakpoint to stack/scale content */
@media (max-width: 100%) {
    .content { 
      padding: 1rem;
      margin-right: 1rem;
      margin-left: 1rem;
      width: calc(100% - 2rem);
    }
    .link { margin-left: 0; display:flex; flex-wrap:wrap; gap:0.5rem; }
}

/* Mobile-specific */
@media (max-width: 100%) {
    .wrapper { height: auto; transform: scale(1); padding: 0.6rem; }
    .wrapper .form-box { padding: 1%; }
    .navigation .btnLogin-popup { width: auto; height: auto; padding: 0.6rem 0.9rem; font-size: 0.95rem; }
}

img, svg {
    max-width: 100%; /* Ensures images scale down on small screens */
    height: auto;    /* Prevents image distortion */
}

