/* =========================================
   1. GLOBAL RESETS & TYPOGRAPHY
========================================= */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    /* Removed height: 100% to let min-height: 100vh do the heavy lifting safely */
}

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 14px;
    color: #000;
    letter-spacing: 1px; 
    
    /* THE STICKY FOOTER ENGINE */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensures the body is always at least the height of the screen */
}
/* Grouping the zero-margins for cleaner code */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 20px;
}

.normal_text {
    text-align: justify;
    font-size: 0.9em;
}

/* Now we only specify what makes each heading unique! */
h1 { font-size: 20px; font-weight: bold; color: #FFF; font-style: italic; padding: 11px 0 0 20px; }
h2 { font-size: 10px; font-weight: bold; color: #FFF; padding: 13px 0 0 20px; }
h3 { font-size: 12px; font-weight: bold; color: #666; font-style: italic; padding: 0 0 0 20px; }
h4 { font-size: 16px; font-weight: bold; color: #666; font-style: italic; padding: 20px 0 0 20px; }
h5 { font-size: 16px; font-weight: bold; color: #E67300; font-style: italic; padding: 30px 0 0 20px; text-align: left; }

p {
    font-size: 12px;
    color: #333;
    line-height: 20px;
}

/* Removes blue borders on linked images */
a img { border: none; } 

/* =========================================
   2. GLOBAL LINKS (Simplified)
========================================= */
a { color: #E67300; text-decoration: none; } /* Default base link */
a:hover { text-decoration: underline; } /* Default hover effect */

a.class1 { color: #E67300; text-decoration: underline; }
a.class2 { color: #FFF; text-decoration: none; }
a.class3 { color: #FFF; text-decoration: underline; }
a.class4 { color: #E67300; text-decoration: none; }
a.class5 { color: #AEAEAE; text-decoration: none; }
a.class5:hover { background-color: #F5FFD9; }
a.class6 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class6:visited { color: #BEBEBE; }
a.class7 { color: #666; font-weight: bold; text-decoration: underline; }
a.class8 { color: #666; font-weight: bold; text-decoration: none; }
a.class9 { color: #666; text-decoration: none; }
a.class9:hover { background-color: #F5FFD9; }
a.class10, a.class12 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class11 { color: #999; text-decoration: underline; }
a.class13 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class13:visited { color: #2B82AC; }
a.class14 { color: #FFF; font-weight: bold; text-decoration: none; text-shadow: 1px 1px #666; }

/* =========================================
   3. LAYOUT CONTAINERS
========================================= */

.container, .container-flex, .body_wrp, .main_wrp {
    flex: 1; 
}

/* Your original legacy container */
.container {
    width: 100%;
    max-width: 1920px;
    min-width: 1024px;
    margin: 0 auto; 
}

/* The New Reborn Container */
.container-flex {
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    box-sizing: border-box; 
}

/* =========================================
   5. MEMBERS AREA HEADER (FLEXBOX)
========================================= */

/* The Main Header Wrapper */
.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Or 100% if you want it edge-to-edge */
    margin: 10px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Grouping the Hamburger and Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-btn {
    cursor: pointer;
    transition: opacity 0.2s;
}
.hamburger-btn:hover { opacity: 0.8; }

/* Grouping the Title and Profile */
.header-right {
    display: flex;
    align-items: center;
    background-color: #666666;
    border-radius: 10px;
    height: 45px;
    padding-left: 20px;
    position: relative; /* CRITICAL: Traps the profile dropdown menu inside this box! */
}

.header-title {
    color: #FFF;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    margin: 0; /* Removes old h1 margins */
    padding-right: 20px;
    border-right: 1px solid #888; /* Nice divider between title and profile */
}

/* The Clickable Profile Button */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0 15px;
    color: #FFF;
    font-weight: 600;
}

/* The Hidden Dropdown Menu */
#profile_menu {
    display: none;
    position: absolute;
    top: 55px; /* Pushes it right below the grey bar */
    right: 0; /* Aligns it to the right edge */
    width: 250px;
    background-color: #666;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

#profile_menu .profile_items a {
    display: block;
    color: #FFF;
    text-decoration: none;
    padding: 12px 20px;
    transition: background 0.2s;
}
#profile_menu .profile_items a:hover {
    background-color: #E67300; /* Brand orange on hover! */
}

/* =========================================
   6. SLIDING SIDEBAR (.sidenav2)
========================================= */
.sidenav2 {
    height: 100%;
    width: 0; 
    position: fixed; 
    z-index: 1000; /* Ensure it covers everything */
    top: 0;
    left: 0;
    background: rgba(224, 224, 224, 0.98); /* Solidified slightly for readability */
    overflow-x: hidden; 
    padding-top: 60px; 
    transition: 0.3s; /* Sped up from 0.5s for a snappier feel */
    border-right: 2px solid #9F9F9F;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
}

.sidenav2 ul {
    padding: 0;
    margin: 0;
}

.sidenav2 ul li {
    list-style: none;
}

.sidenav2 a {
    padding: 15px 20px 15px 40px;
    text-decoration: none;
    font-size: 1.1em;
    color: #666;
    display: block;
    font-weight: 600;
    transition: 0.2s;
}

.sidenav2 a:hover { color: #E67300; }

.sidenav2 .closebtn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    padding: 0;
    color: #999;
}
.sidenav2 .closebtn:hover { color: #E67300; }

/* =========================================
   4. MODERN UNIFIED FOOTER
========================================= */

/* The main outer wrapper: Full-width dark gray background */
.modern_footer_wrp {
    width: 100%;
    background-color: #4C4C4C;
    padding: 40px 15px; 
    box-sizing: border-box;
    font-family: Verdana, Geneva, sans-serif;
    border-top: 5px solid #FFF; /* Kept from your old .footer_div_container! */
}

/* Container to keep desktop text from stretching too wide */
.footer_inner {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

/* The Magic Flexbox Rows */
.footer_flex_row {
    display: flex;
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap; 
    gap: 60px; 
}

.top_links { margin-bottom: 25px; }
.sub_links { margin-top: 25px; margin-bottom: 35px; }

/* Clean styling for the divider lines */
.footer_divider {
    border: 0;
    border-top: 1px solid #777;
    margin: 0;
}

/* Copyright Text */
.footer_copyright {
    color: #E1E1E1;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 30px;
}

/* --- FOOTER TYPOGRAPHY & LINK STYLES --- */

.modern_footer_wrp a {
    text-decoration: none; 
    transition: opacity 0.2s ease-in-out; 
}

.modern_footer_wrp a:hover {
    opacity: 0.7; 
}

/* TOP ROW: Bright White, Bold, and Thick */
.top_links a {
    color: #FFFFFF; 
    font-size: 18px; 
    font-weight: bold;
    letter-spacing: 1px; 
}

/* BOTTOM ROW: Matches the copyright text */
.sub_links a {
    color: #E1E1E1; 
    font-size: 14px;
    font-weight: normal;
}

/* --- MOBILE FOOTER FIXES --- */
/* Flexbox naturally handles the wrapping, we just tell it to stack as a column on phones! */
@media (max-width: 768px) {
    .footer_flex_row {
        gap: 20px; 
        flex-direction: column; 
    }
}

/* =========================================
   7. GLOBAL STRUCTURE FIXES
========================================= */
/* Modern Sticky Footer Fix */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.content, .container-flex {
    flex: 1 0 auto; 
}
.modern_footer_wrp { 
    flex-shrink: 0; 
}

/* =========================================
   8. GLOBAL FORM STYLES (UI KIT)
========================================= */
/* Form Rows */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}
.form-group label {
    font-family: Verdana, sans-serif;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: Verdana, sans-serif;
}
.form-control:focus {
    border-color: #E67300;
    outline: none;
    box-shadow: 0 0 5px rgba(230, 115, 0, 0.3);
}

/* Desktop layout: Labels on left, Inputs on right */
@media (min-width: 768px) {
    .form-group {
        flex-direction: row;
        align-items: flex-start; 
    }
    .form-group label {
        width: 180px;
        margin-bottom: 0;
        text-align: right;
        margin-right: 20px;
        padding-top: 12px; 
    }
    .input-wrapper {
        flex: 1;
        max-width: 400px;
    }
}

/* Modern Buttons */
.btn-modern {
    background: #E67300;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    min-width: 150px;
}
.btn-modern:hover { background: #cc6600; }
.btn-secondary { background: #999; }
.btn-secondary:hover { background: #777; }
.btn-group { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }

/* jQuery Validation Error Styles */
label.error {
    color: #ED7476;
    font-size: 0.85em;
    font-weight: 600;
    display: block;
    margin-top: 5px;
}
input.error, select.error {
    border: 1px solid #ED7476;
    background: #FFEDED;
}

/* =========================================
   9. PAGE SPECIFIC: ACCOUNT DETAILS
========================================= */
.account-container {
    max-width: 800px;
    margin: 40px auto;
    background: #FFFFFF;
    border: 2px solid #9F9F9F;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.account-header {
    background-color: #E67300;
    color: #FFFFFF;
    padding: 15px 25px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 1px;
}
.account-body {
    padding: 30px;
}
.security-section {
    background: #fdf5ef; 
    border: 1px solid #fbdcb8;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
}

/* Keep the Tokyo clock on a single line */
#tP {
    white-space: nowrap;
}

/* Make sure your footer NEVER squishes on long pages */
footer, .modern_footer_wrp {
    flex-shrink: 0;
}