/* Global styles for consistent headers and footers */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0a0f1c, #1f2940);
    color: #fff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Standardized Header Styles */
header {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    width: 100%;
    height: 60px; /* Fixed consistent height */
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%;
    height: 100%;
}

/* Site Brand & Logo */
.site-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0;
    height: 50px;
}

.site-brand a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    height: 100%;
    justify-content: center;
}

.brand-text h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 2px;
    padding: 0;
}

.header-logo {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

.brand-text .username {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.2;
    white-space: nowrap;
    padding: 0;
}

/* Navigation Styles */
.nav-menu {
    flex-shrink: 0;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-menu ul li {
    margin: 0 5px;
}

.nav-menu ul li a {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(0, 153, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 13px;
    white-space: nowrap;
}

.nav-menu ul li a:hover, 
.nav-menu ul li a.active {
    background: rgba(0, 153, 255, 0.5);
    transform: translateY(-2px);
}

/* Style for the authenticated user buttons to make them stand out */
.nav-menu ul li:nth-last-child(1) a,
.nav-menu ul li:nth-last-child(2) a,
.nav-menu ul li:nth-last-child(3) a {
    background: rgba(0, 190, 255, 0.35);
    font-weight: 700;
}

/* Standardized Footer Styles */
footer {
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 0;
    margin-top: auto;
    width: 100%;
    height: 60px; /* Fixed consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.footer-text {
    margin: 0 0 5px 0;
    line-height: 1.5;
}

.footer-text a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    margin: 0 10px;
}

.footer-text a:hover {
    opacity: 1;
}

.footer-content p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Main Content Wrapper */
main {
    flex: 1;
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        height: auto;
        padding: 10px 0;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .site-brand {
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .brand-text {
        align-items: center;
        text-align: center;
    }
    
    .nav-menu {
        width: 100%;
    }
    
    .nav-menu ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-menu ul li {
        margin: 3px;
    }
    
    .nav-menu ul li a {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    footer {
        height: auto;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .site-brand {
        flex-direction: row; /* Keep horizontal layout */
        height: auto; /* Allow natural height */
    }
    
    .header-logo {
        height: 30px;
    }
    
    .brand-text {
        margin-left: 10px;
    }
    
    .brand-text h1 {
        font-size: 18px;
    }
    
    .brand-text .username {
        font-size: 12px;
    }
    
    .nav-menu ul li a {
        padding: 5px 8px;
        font-size: 11px;
    }
}
