/* style.css - The Global Look */

:root {
    --primary: #2c3e50;    /* Dark Blue */
    --accent: #3498db;     /* Bright Blue */
    --bg: #f4f7f6;         /* Light Grey Background */
    --text: #333;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- NAVIGATION BAR (Responsive & Dropdown) --- */
nav {
    background-color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: relative;
    min-height: 60px;
}

.nav-brand a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.4rem;
}

/* Hide the checkbox that controls the mobile menu */
#menu-toggle {
    display: none;
}

/* The hamburger icon (hidden on desktop) */
.menu-icon {
    display: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 10px 15px;
    user-select: none;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: block;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
    background-color: #1a252f;
    color: var(--accent);
}

/* Dropdown Styling */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--primary);
    min-width: max-content; 
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    top: 100%;
    left: 0;
}

/* Fix: Pulls the last dropdown (Games) inward so it doesn't go off the right side of the screen */
.nav-links li:last-child .dropdown-content {
    left: auto;
    right: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    padding: 12px 16px;
    border-bottom: 1px solid #1a252f;
    font-size: 1rem;
    white-space: nowrap; 
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* --- MOBILE VIEW (Hamburger Menu) --- */
@media screen and (max-width: 768px) {
    .menu-icon {
        display: block; /* Show hamburger icon */
    }
    
    .nav-links {
        display: none; /* Hide links by default */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Directly below nav */
        left: 0;
        width: 100%;
        background-color: var(--primary);
        z-index: 999;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    }

    /* When checkbox is checked, show the menu */
    #menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
    }

    .dropdown-content {
        position: static; /* Let it flow normally in the column */
        box-shadow: none;
        background-color: #1a252f;
        min-width: 100%;
    }

    .dropdown-content a {
        padding-left: 2.5rem; /* Indent sub-items so they look nested */
        white-space: normal; /* Allows text to wrap normally on mobile if needed */
    }
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Headers */
h1 { color: var(--primary); text-align: center; }
h2 { color: var(--accent); margin-top: 0; }

/* Standard Cards/Boxes */
.game-area {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    min-height: 300px;
}

/* --- VIDEO EMBED STYLES --- */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- BUTTON STYLES --- */

/* 1. Default Global Button (Blue with White Text) */
button {
    background-color: var(--accent);
    color: white; 
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin: 5px;
    transition: background 0.2s, transform 0.1s;
}

button:hover { 
    background-color: #2980b9; 
    transform: translateY(-2px);
}

/* 2. Specific Fix for Game/Option Buttons (White with Dark Text) */
.game-btn, .option-btn {
    color: var(--text) !important; /* Forces text to be dark */
    background-color: var(--white);
    border: 2px solid #ccc;
}

.game-btn:hover, .option-btn:hover {
    background-color: #e2e6ea;
    color: var(--text) !important;
}

/* --- FORM ELEMENTS (Text Boxes & Dropdowns) --- */
select, input, textarea {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text);      
    background-color: var(--white); 
}

/* --- INLINE BACK TO TOP ARROWS --- */
/* Targets back-to-top links specifically inside your glossary/unit sections */
.unit-section a[href="#top"],
.topic-section a[href="#top"],
.inline-top-arrow {
    color: var(--primary); 
    font-weight: bold;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.unit-section a[href="#top"]:hover,
.topic-section a[href="#top"]:hover,
.inline-top-arrow:hover {
    color: #1a252f; 
    transform: translateY(-2px);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #ddd;
}

footer a {
    color: #2980b9; 
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

footer a:hover {
    color: #1a5276;
    text-decoration: underline;
}

/* --- ADSENSE SAFETY TOGGLE --- */
/* Hides ad containers entirely while under review to prevent awkward blank spaces */
.ad-under-review {
    display: none !important;
}
