/* 
orange:     #ff6801 
Aqua:       #0bf1f7
Dark Blue:  #14045b
*/  

/* MOBILE */
/* Hamburger button hidden by default (shown on mobile) */

/* ==== ORIGINAL HEADER CSS (FIXED) ==== */

.app-header {
    box-shadow: 0px 4px 10px 2px rgba(0,0,0,0.2);
    background-color: white;
}

.app-header .container {
    position: relative;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header .nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
}

.app-header i {
    color: #14045b;
    width: 24px;
    height: 24px;
}

.app-header .left-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.app-header .app-title {
    color: #14045b;
    font-size: 24px;
    font-weight: 400;
}

.nav-button,
.nav-button-active {
    color: #14045b;
    text-decoration: none;
    font-weight: 400;
    font-size: 24px;
    transition: color 0.2s ease;
}

.nav-button-active {
    color: #ff6801;
}

.nav-button-active i {
    color: #ff6801;
}

.nav-button:hover, .nav-button i:hover {
    color: #ff6801;
}

.header-logo {
    width: 50px;
    height: 50px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #14045b;
    transition: 1s;
}


/* general layout */

* {
    font-family: "Comfortaa", sans-serif;
    font-optical-sizing: auto;

}

body {
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    margin: 0 auto;
}

button {
    background-color: #14045b; 
    color: white;
    padding: 5px 10px 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s ease;
}

form button {
    padding: 5px 10px 5px 10px;
}


#logout {
    padding: 0px;
    background-color: transparent;
}

#logout:hover {
    background-color: transparent;
}

button:hover {
    background-color: #ff6801; 
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.4rem;
}

h3 {
    font-size: 2.0rem;
}

h4 {
    font-size: 1.8rem;
}

td {
    border-color: #14045b;
    border-style: solid;
    border-width: 1px;
    padding: 5px;
    height: 40px;
}

th {
    border-color: #14045b;
    border-style: solid;
    border-width: 1px;
    padding-left: 5px;
    padding-right: 5px;
}

input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.3s;
    width: 100%;
}

textarea {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.3s;
}


/* Scoped only for styled forms */
/* Existing .styled-form stays the same */

.styled-form {
    background-color: white;
    padding: 2rem;
    border-width: 1px;
    border-radius: 8px;
    border-color: #eee;
    box-shadow: 0px 6px 10px 1px rgba(0,0,0,0.1);
    max-width: 500px;
    min-width: 400px;
}

.styled-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding-left: 40px; /* room for icon */
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.styled-form .input-wrapper:focus-within {
    border-color: #ff6801;
    background-color: #fff;
}

/* Icon styling */
.styled-form .input-wrapper i {
    position: absolute;
    left: 14px;
    color: #14045b;
    font-size: 18px;
    pointer-events: none;
    top: 12px;
}

/* Input + Textarea unified */
.styled-form input,
.styled-form textarea,
.styled-form select {
    width: 100%;
    padding: 10px 14px;
    padding-left: 0; /* icon takes care of spacing */
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 15px;
    color: #14045b;
    outline: none;
    resize: none; 
}

.styled-form input::placeholder,
.styled-form textarea::placeholder {
    color: #14045b;
    opacity: 0.5;
}

.styled-form h2 {
    font-size: 22px;
    color: #14045b;
    margin-bottom: 20px;
}

.styled-form button {
    width: 100%;
    background-color: #ff6801;
    padding: 15px;
    box-shadow: 0px 6px 10px 1px rgba(0,0,0,0.1);   
    margin-bottom: 20px;
}

.styled-form button:hover {
    background-color: #cc5200;
    box-shadow: inset 0px 6px 10px 1px rgba(0,0,0,0.1); 
}

.error-message {
    background-color: #ffe6e6;
    border: 1px solid #ff4d4d;
    color: #b30000;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 1rem;
    position: relative;
    animation: fadeInSlide 0.4s ease-in-out;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.1);
}

.error-message strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message ul {
    margin: 0;
    padding-left: 1.2rem;
}

.error-message li {
    list-style-type: disc;
}

/* ==== MOBILE STYLES (FIXED INTERFERENCE) ==== */

@media screen and (max-width: 768px) {

    .styled-form {
        min-width: calc(100vw - 50px);
    }

    .styled-form h2 {
        font-size: 20px;
    }

    .styled-form label {
        font-size: 14px;
    }

    .app-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        position: relative;
    }

    .app-header .left-logo {
        justify-content: flex-start;
        width: auto;
    }

    .hamburger {
        display: block;
    }

    .app-header .nav-links {
        position: absolute;
        top: 100%;
        flex-direction: column;
        gap: 8px;
        width: 150px;
        background-color: #fff;
        box-shadow: 0px 6px 10px 1px rgba(0,0,0,0.4);
        padding: 10px 15px;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
        z-index: 10;
        left: calc(100vw - 186px);
        top: 75px;
        /* Transition setup */
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        max-height: 0;
        overflow: hidden;

        transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
        display: flex; /* Always flex, just hidden visually */
    }


    .app-header .nav-links.show {
        display: flex; /* shown when toggled */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        max-height: 500px; /* large enough to contain the menu */
        left: calc(100vw - 186px);
        top: 70px;
    }

    .nav-button,
    .nav-button-active {
        font-size: 18px;
        width: 100%;
        padding: 8px 0;
        text-align: left;
    }

    .app-header {
        overflow: visible; /* ensure popup menu is visible outside header bounds */
    }
}
