/* Reset and Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --header-height-desktop: 150px;
    --header-height-mobile: 100px;
    --container-padding: 1rem;
    --primary-color: #007bff;
    --background-color: #f8f8f8;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Base Layout */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
	 margin-top: 0;
	    padding-top: 0;


}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: #333;
    line-height: 1.5;
    position: relative;
    min-width: 320px;
}

/* Header Styles */
.main-header {
    position: relative; /* Change from fixed to relative */
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 1; /* Lower z-index */
	overflow: hidden; /* Hide anything that goes beyond 150px */
    background-color: #fff;
}

.banner-image {
    width: 100%;
    height: var(--header-height-desktop);
    object-fit: cover;
    display: block;
}

.header-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    z-index: 101;
}

/* Main Content Layout */
main {
    position: relative;
    width: 100%;
    padding: 1rem;
    background-color: #f8f8f8;
    z-index: 2; /* Higher z-index than header */
}

/* Form Container */
.form-container {
    position: relative;
    z-index: 2; /* Higher z-index than header */
    width: 100%;
    max-width: 600px;
    margin: 1rem auto;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.button-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.big-button {
    width: 100%;
    min-height: 3.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
    cursor: pointer;
    margin: 0;
}

.big-button:hover {
    background-color: #0056b3;
}

/* Navigation Overlay */
.nav-overlay {
    height: 0;
    width: 100%;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.95);
    overflow-y: hidden;
    transition: height 0.3s ease-in-out;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.nav-overlay-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
}

.nav-link {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-link {
    margin-top: 2rem;
    background-color: rgba(220, 53, 69, 0.2);
}

.logout-link:hover {
    background-color: rgba(220, 53, 69, 0.3);
}

/* Typography */
h1 {
    font-size: clamp(1.25rem, 4vw, 2rem);
    text-align: center;
    margin: 0 0 1rem 0;
    padding: 0 1rem;
    width: 100%;
}

/* Form Elements */
.form-group {
    width: 100%;
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Mobile Styles */
@media screen and (max-width: 480px) {
    :root {
        --container-padding: 0.5rem;
    }

    .main-header {
        height: var(--header-height-mobile);
    }

    .banner-image {
        height: var(--header-height-mobile);
    }

    main {
        margin-top: var(--header-height-mobile);
        min-height: calc(100vh - var(--header-height-mobile));
        padding: var(--container-padding);
    }

    .form-container {
        margin: 0.5rem 0;
        padding: 1rem;
        border-radius: 0;
        box-shadow: none;
    }

    .big-button {
        padding: 0.875rem;
        min-height: 3rem;
    }

    .header-content {
        padding: 0.5rem;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.875rem;
    }
}

/* Tablet Styles */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .form-container {
        width: calc(100% - 1rem);
        margin: 0.5rem;
    }
}

/* Desktop Styles */
@media screen and (min-width: 769px) {
    .form-container {
        padding: 2rem;
    }
    
    main {
        padding: 2rem;
    }
}

/* Safe Area Insets */
@supports (padding: max(0px)) {
    .header-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .nav-overlay-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Safari Fixes */
@supports (-webkit-touch-callout: none) {
    .form-container {
        width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right));
    }
}