/* ============================================================
/* ============================================================
   1. GLOBAL RESET & BASE LAYOUT
   ============================================================ */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevents horizontal shaking */
}

body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    display: block; /* Change from flex to block */
    background-color: #f0f4ff;
    font-family: Arial, sans-serif;
}

/* Sidebar Container now acts as a horizontal bar */
/* ============================================================
   1. NAVIGATION BAR (STRETCHED EDGE-TO-EDGE)
   ============================================================ */
#sidebar-placeholder {
    width: 100% !important;   /* Force it to take the whole screen width */
    background-color: #d9e3ff;
    border-bottom: 2px solid #2f52b5; 
    border-right: none !important;    /* Remove any side lines */
    margin: 0;
    padding: 0;
}

nav {
    display: flex;            /* Use flexbox to align items in a row */
    flex-direction: row;      
    width: 100%;              /* Ensure nav fills the placeholder */
    margin: 0;
    padding: 0;
}

nav a {
    flex: 1;                  /* THIS IS THE MAGIC: it forces links to stretch equally */
    text-align: center;       /* Centers the text/icons in that stretched space */
    white-space: nowrap; 
    text-decoration: none;
    color: #2f52b5;
    padding: 15px 10px;       
    font-weight: bold;
    font-size: 1rem;          /* Slightly bigger for the top bar */
    border-right: 1px solid rgba(47, 82, 181, 0.2); 
    display: block; 
}

/* Remove the border from the very last icon/link */
nav a:last-child {
    border-right: none;
}

/* ============================================================
/* ============================================================
 /* ============================================================
   2. HEADER (The Blue Banner)
   ============================================================ */
header {
    background-color: #2f52b5 !important;
    color: white !important;
    padding: 10px 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;      
    align-items: center;      
    justify-content: flex-end; /* This pushes the Flag/Icon group to the right */
    position: relative; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 80px; 
}

header::before {
    position: absolute; 
    left: 20px;
    top: 50%; 
    transform: translateY(-50%);
    width: 100px; 
    height: 100px;
    content: "";
    display: block;
    background-image: url('../images/hackczech-logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

header h1 {
    /* THIS IS THE CENTER TRICK */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    color: white !important;
    font-size: 1.5rem;
    white-space: nowrap;
}

#auth-icon {
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    user-select: none;
    margin-left: 10px; /* Space between flag and icon */
}

/* This targets the flag container you already have */
#language-selector-container {
    margin-left: auto; /* This pushes the flag to the right */
    display: flex;
    align-items: center;
    gap: 15px; /* This creates the space between the flag and the icon */
    z-index: 10;
}

/* This ensures the icon stays next to the flag */
#auth-icon {
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* ============================================================
   AUTOMATIC LAYOUT LOGIC
   ============================================================ */

/* HOME PAGE: Make logo big and put it back into the normal flow (Centered) */
body:has(nav.home-nav) header {
    padding-top: 40px;
}

body:has(nav.home-nav) header::before {
    position: static;   /* Returns to center above text */
    transform: none;    /* Removes the vertical centering math */
    width: 150px;
    height: 150px;
    margin: 0 auto 20px auto;
}
/* ============================================================
   3. NAVIGATION LOGIC
   ============================================================ */
/* Sidebar Container */
#sidebar-placeholder {
    /* Change 'width: 250px' to these two lines: */
    width: max-content; 
    min-width: 200px; /* Optional: keeps it from being too skinny on short words */
    
    background-color: #d9e3ff;
    border-right: 2px solid #2f52b5;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Ensure the links don't wrap to a second line */
nav a {
    white-space: nowrap; /* This is the secret! It forces the width to fit the text */
    text-decoration: none;
    color: #2f52b5;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(47, 82, 181, 0.2); 
    display: block; /* Makes the whole area clickable */
}

/* ============================================================
   3.5 CONTENT SPACING
   ============================================================ */
.page-content {
    flex: 1;             /* Takes up the remaining width */
    padding-left: 40px;  /* Space between sidebar line and text */
    padding-right: 20px; /* Prevents text from touching right edge */
    padding-top: 20px;   /* Space below the header */
}

/* ============================================================
   4. VOCABULARY TABLE
   ============================================================ */
.table-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(47, 82, 181, 0.1);
}

th {
    background-color: #d9e3ff !important;
    color: #2f52b5 !important;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #2f52b5;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #d9e3ff;
}

/* ============================================================
   5. BUTTONS (Practice, Test, Home)
   ============================================================ */
.big-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 30px !important;
    margin: 40px auto !important;
    flex-wrap: wrap;
}

.big-buttons a {
    padding: 16px 36px !important;
    background: linear-gradient(180deg, #2f52b5 0%, #1a3580 100%) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    font-weight: bold;
    box-shadow: 0 6px 15px rgba(47, 82, 181, 0.2);
    transition: transform 0.2s;
}

.big-buttons a:hover { transform: translateY(-3px); }

.small-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 15px !important;
    margin: 20px auto 40px auto !important;
}

.small-buttons a {
    padding: 8px 18px !important;
    background: white !important;
    color: #2f52b5 !important;
    border: 2px solid #2f52b5 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-weight: bold;
}

/* ============================================================
   6. FOOTER
   ============================================================ */
#footer-placeholder {
    display: block;
    width: 100%;
    clear: both;
    /* This is the magic: it forces the browser to allow scrolling 
       past the text so the second line is never cut off */
    margin-bottom: 0px; 
}

footer.support-note {
    text-align: center;
    /* Very tight top (10px) to stay near the line */
    padding: 10px 20px 0px 20px; 
    background-color: #f0f4ff;
    border-top: 1px solid #d9e3ff;
    width: 100%;
    box-sizing: border-box;
}

/* Remove all browser defaults that push text around */
footer.support-note #footer-text, 
footer.support-note p {
    margin: 5px 0 !important; 
    padding: 0 !important;
    line-height: 1.4;
    display: block;
}

/* ============================================================
   7. MOBILE OVERRIDES (Only for screens smaller than 768px)
   ============================================================ */
@media (max-width: 768px) {
    body {
        display: flex; /* Re-enable flex so the column direction works */
        flex-direction: column;
        min-height: 100vh;
    }
    
    /* This prevents ads from pushing your header off-screen */
    header {
        flex-shrink: 0;
    }

   #sidebar-placeholder, #study-filters {
        width: 100%;
        border-right: none;
        box-sizing: border-box; /* Ensures padding doesn't break width */
    }

    #study-filters {
        margin-bottom: 15px; /* Adds space between filters and test box */
    }

    main {
        flex-direction: column;
        align-items: center;
    }
    
    header::before {
        display: none; /* Optional: hides logo icon on mobile to save space */
    }



/* Zebra Striping for Vocabulary */
#vocabTable tbody tr:nth-child(even) {
    background-color: #f9faff;
}

#vocabTable td:first-child {
    font-weight: bold;
    color: #2f52b5;
}

.table-container {
    margin-bottom: 30px;
}

}

/* ============================================================
   8. AUTHENTICATION & LOCK SCREENS
   ============================================================ */

/* Full screen dark overlay */
#auth-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #2c3e50; display: none; justify-content: center; align-items: center; z-index: 10000; }




/* The Login Box */
.auth-card { 
    background: white; 
    padding: 30px; 
    border-radius: 15px; 
    width: 320px; 
    text-align: center; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    color: #2c3e50; /* Ensures text is dark and readable */
}

.auth-card h2 {
    margin-top: 0;
    color: #2f52b5;
}

.auth-card input { 
    width: 100%; 
    padding: 10px; 
    margin: 8px 0; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    box-sizing: border-box; 
}

/* The "Premium" lock screen */
#unpaid-message { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; display: none; justify-content: center; align-items: center; flex-direction: column; text-align: center; color: #2c3e50; z-index: 9999; }




/* Prevent the site from 'trapping' ad overlays */
ins.adsbygoogle, 
div[id^="google_ads"], 
.google-ads-vignette,
iframe[id^="google_ads_iframe"] {
    z-index: 2147483647 !important; /* Maximum possible z-index */
}

/* Ensure the 'X' button isn't hidden by your auth overlays */
#auth-overlay, #unpaid-message {
    z-index: 99999; 
}




