/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #e6f3ff 0%, #ffffff 100%);
    color: #333;
    line-height: 1.6;
    font-size: 90%;
    min-height: 100vh;
    overflow: auto;
}

/* Logo Box - Header with Responsive Background Positioning */
.box_logo {
    position: relative;
    background: #1e40af url('media/messeteam.logo.png') left center / contain no-repeat; /* Left-aligned on desktop */
    border: none;
    width: 100%;
    height: 112px;
    top: 0;
    left: 0;
    z-index: 2;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Text logo, positioned at bottom if needed */
.text_logo {
    font-size: 2em;
    font-weight: bold;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Login/Logout Box - Top Right, Clickable */
.box_login, .box_logout {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid #ffd463;
    padding: 10px;
    height: auto;
    width: auto;
    z-index: 4;
    overflow: hidden;
    background: #f0f8ff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: smaller;
}

.box_login.hidden, .box_logout.hidden, .box_main.hidden {
    display: none; /* Hide when hamburger menu is open */
}

.box_login form, .box_logout {
    text-align: center;
}

.box_login table {
    border: none;
}

.box_login td {
    padding: 5px;
    font-size: 80%;
}

.box_login input[type="text"], .box_login input[type="password"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #ffd463;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.box_login input[type="submit"] {
    background: #ffd463;
    color: #333;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.box_login input[type="submit"]:hover {
    background: #1e40af;
    color: #fff;
}

.box_logout a {
    color: #ffd463;
    text-decoration: none;
}

.box_logout a:hover {
    text-decoration: underline;
}

/* Navigation Box - Sidebar on Desktop */
.box_navigation {
    position: absolute;
    background: #f0f8ff;
    border: none;
    padding: 15px;
    width: 23%;
    top: 130px;
    right: 5px;
    z-index: 3;
    overflow: auto;
    color: #333;
    height: auto;
    min-height: 260px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.box_navigation p {
    margin: 10px 0;
    display: block; /* Each menu item on a new line */
}

.box_navigation p:has(a) {
    padding-left: 20px; /* Indent for submenu hierarchy */
    position: relative;
    font-size: 0; /* Hide original "-->" text */
}

.box_navigation p:has(a)::before {
    content: '→ '; /* Arrow for subitems */
    font-size: 14px; /* Readable size for arrow */
    position: absolute;
    left: 0;
    color: #1e40af;
}

.box_navigation a {
    color: #1e40af;
    text-decoration: none;
    font-weight: bold;
    display: inline; /* Keep arrow and link inline */
    font-size: 14px; /* Readable link text */
    transition: color 0.3s;
}

.box_navigation a:hover {
    color: #ffd463;
}

.box_navigation strong {
    font-weight: bold;
    margin-top: 10px;
    display: block;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 6; /* Above login/logout */
}

/* Background Box - Main Container */
.box_background {
    background: transparent;
    border: none;
    width: 100%;
    min-height: calc(100vh - 150px);
    padding: 10px; /* Reduced padding to free up space */
    position: relative;
    top: 0;
    left: 0;
    z-index: 1;
}

.box_background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113.64,31.08,1200,41.67V0H0Z" fill="%23ffffff"/></svg>') no-repeat bottom;
    background-size: 100%;
    opacity: 0.8;
}

/* Main Content */
.box_main {
    height: auto;
    padding: 20px;
    margin: 0;
    width: 100%; /* Ensure full width on mobile */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.box_main p {
    margin: 15px 0;
    font-size: 1.1em;
}

.box_main a {
    color: #1e40af;
    text-decoration: none;
}

.box_main a:hover {
    color: #ffd463;
}

/* Table Styling for Messeplan */
#rounded-corner {
    font-family: Arial, sans-serif;
    font-size: 12px;
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#rounded-corner th {
    padding: 8px;
    font-weight: normal;
    font-size: 13px;
    color: #333;
    background: #b9c9fe;
}

#rounded-corner td {
    padding: 8px;
    background: #e8edff;
    border-top: 1px solid #fff;
    color: #669;
}

#rounded-corner tbody tr:hover td {
    background: #d0dafd;
}

.rounded-head-left, .rounded-head-right {
    background: #b9c9fe !important;
}

.rounded-foot-left, .rounded-foot-right {
    background: #e8edff !important;
}

/* Validate Box - Fixed Bottom Right */
.box_validate {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #1e40af;
    border: none;
    padding: 15px;
    height: auto;
    width: 23%;
    z-index: 3;
    color: #fff;
    font-size: 90%;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.text_copyright {
    font-size: 80%;
}

.box_validate a img {
    border: 0;
    width: 88px;
    height: 31px;
}

/* Links Styling */
a:link, a:visited {
    text-decoration: none;
    font-weight: bold;
    color: #1e40af;
}

a:hover {
    color: #ffd463;
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 1000px) {
    .hamburger {
        display: block;
    }

    .box_navigation {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        width: 100%;
        top: 112px;
        right: 0;
        height: auto;
        background: #f0f8ff;
        z-index: 3;
    }

    .box_navigation.active {
        display: block; /* Shown when hamburger clicked */
        position: fixed; /* Lock in place */
        top: 112px; /* Align with logo height */
        z-index: 10; /* Above main content */
    }

    .box_background {
        padding: 10px; /* Consistent minimal padding */
    }

    .box_main {
        width: 100%; /* Full width */
        padding: 10px; /* Reduced padding to maximize space */
    }

    .box_validate {
        position: relative;
        width: 100%;
        right: 0;
        bottom: 0;
    }

    .box_logo {
        background-position: center center; /* Centered on mobile */
        height: auto;
        padding: 20px 0;
    }

    .box_login, .box_logout {
        position: relative;
        top: 0;
        right: 0;
        margin: 10px auto;
    }

    /* Table Stacking on Mobile (Adjusted for Width and Alignment) */
    #rounded-corner {
        display: block; /* Stack table */
    }

    #rounded-corner thead {
        display: none; /* Hide header row completely */
    }

    #rounded-corner tbody tr {
        display: block; /* Stack each row */
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        background: #f9f9f9;
        border-radius: 4px;
        width: 100%; /* Full width to use available space */
    }

    #rounded-corner td {
        display: block; /* Stack cells vertically */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 15%; /* Reduced space for header label to make content wider */
        white-space: normal;
        text-align: right; /* Align values to right */
        min-height: 30px;
        width: 100%; /* Full width for each cell */
    }

    #rounded-corner td:nth-of-type(1) {
        display: none; /* Hide the empty first column */
    }

    #rounded-corner td:nth-of-type(2)::before { content: "ID: "; }
    #rounded-corner td:nth-of-type(3)::before { content: "Login: "; }
    #rounded-corner td:nth-of-type(4)::before { content: "Name: "; }
    #rounded-corner td:nth-of-type(5)::before { content: "Vorname: "; }
    #rounded-corner td:nth-of-type(6)::before { content: "Letzter Login: "; }
    #rounded-corner td:nth-of-type(7)::before { content: "E-Mail: "; }
    #rounded-corner td:nth-of-type(8)::before { content: "Rolle: "; }
    #rounded-corner td:nth-of-type(9)::before { content: "Admin: "; }
    #rounded-corner td:nth-of-type(10)::before { content: "Aktiv: "; }

    #rounded-corner td::before {
        content: attr(data-label); /* Fallback if data-label added later */
        position: absolute;
        top: 6px;
        left: 6px;
        width: 15%; /* Reduced width to give more space to content */
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
        color: #1e40af;
    }

    body, .box_main {
        overflow-x: hidden; /* No horizontal scroll */
    }
}

@media (max-width: 600px) {
    /* Mobile: Login-Box zentrieren */
    .box_login, .box_logout {
        width: 90%;
        max-width: 300px;
        margin: 10px auto;
        position: relative;
        left: 0;
        right: 0;
        text-align: center;
    }

    /* Nur auf Mobil: Positionstausch bei Login */
    .logged-in .box_login {
        position: static;
        margin: 20px auto;
        display: block;
    }
    .logged-in .box_validate {
        /* Keine Änderung – bleibt fixiert */
    }
}   
/* Validate-Box bleibt fix, Login tauscht nicht mit ihr */
.box_validate {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 3;
}   

/* Fallback for Older Browsers (No :has Support) */
@supports not selector(:has(a)) {
    .box_navigation p {
        display: block; /* Ensure line breaks in fallback */
    }
}