/* --- Global Styles & Variables --- */
:root {
    --bg-color: #F8F8F8;
    --text-color: #333333;
    --primary-color: #007AFF;
    --primary-hover-color: #0056b3;
    --border-color: #e0e0e0;
    --card-bg: #FFFFFF;
    --font-main: 'Inter', sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative; /* Needed for ad positioning context */
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color); text-decoration: none; }
.nav-menu ul { margin: 0; padding: 0; list-style: none; display: flex; }
.nav-menu li { margin-left: 25px; }
.nav-menu a { text-decoration: none; color: var(--text-color); font-weight: 500; transition: color 0.2s; }
.nav-menu a:hover { color: var(--primary-color); }
.hamburger-menu { display: none; cursor: pointer; background: none; border: none; padding: 0; }
.hamburger-menu .bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-color); transition: all 0.3s ease-in-out; }

/* --- Test Title --- */
.test-title-section { text-align: center; padding: 20px 0; }
.test-title-section h1 { margin: 0; font-size: 2.5rem; font-weight: 700; }
.subtitle { font-size: 1.1rem; color: #666; margin-top: 5px; }

/* --- Test Questions Grid --- */
.questions-grid { display: grid; grid-template-columns: 1fr; gap: 15px; background-color: var(--card-bg); padding: 20px; border-radius: 8px; border: 1px solid var(--border-color); margin: 20px 0; }
@media (min-width: 600px) { .questions-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .questions-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- Custom Checkbox Styling --- */
.question-item { display: flex; align-items: center; position: relative; padding-left: 35px; cursor: pointer; font-size: 0.95rem; user-select: none; }
.question-item input { position: absolute; opacity: 0; }
.checkmark { position: absolute; top: 0; left: 0; height: 22px; width: 22px; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; transition: background-color 0.2s; }
.question-item:hover input ~ .checkmark { background-color: #ccc; }
.question-item input:checked ~ .checkmark { background-color: var(--primary-color); border-color: var(--primary-color); }
.checkmark:after { content: ""; position: absolute; display: none; left: 7px; top: 3px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.question-item input:checked ~ .checkmark:after { display: block; }

/* --- Button & Results --- */
.calculate-button { display: block; width: 100%; padding: 15px; font-size: 1.2rem; font-weight: bold; color: #fff; background-color: var(--primary-color); border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; }
.calculate-button:hover { background-color: var(--primary-hover-color); }
.results-section { margin-top: 40px; padding: 30px; background-color: var(--card-bg); border-radius: 8px; text-align: center; border: 1px solid var(--border-color); }
.score-display { font-size: 5rem; font-weight: 700; color: var(--primary-color); margin: 10px 0; }
.score-meaning { font-size: 1.2rem; color: #555; margin-bottom: 20px; }
.disclaimer { font-size: 0.9rem; color: #888; }

/* --- NEW: Advanced Ad Optimization --- */
.ad-placeholder { background-color: #e9e9e9; display: flex; align-items: center; justify-content: center; color: #999; font-size: 1rem; border-radius: 4px; margin: 20px auto; }

/* Responsive Top Banner */
.ad-banner-desktop { width: 728px; height: 90px; display: none; }
.ad-banner-mobile { width: 320px; height: 100px; display: flex; }

/* Skyscraper Ads (Desktop/Tablet Only) */
.ad-skyscraper {
    width: 160px;
    height: 600px;
    position: fixed;
    top: 100px; /* Adjust as needed */
    z-index: 10;
    display: none; /* Hidden by default */
}
.ad-skyscraper.left { left: 20px; }
.ad-skyscraper.right { right: 20px; }

/* Ad Visibility Media Queries */
@media (min-width: 768px) {
    .ad-banner-desktop { display: flex; }
    .ad-banner-mobile { display: none; }
}
@media (min-width: 1300px) { /* Screen wide enough for side ads */
    .ad-skyscraper { display: flex; }
}

.ad-banner-bottom { min-height: 250px; max-width: 300px; }

/* --- Footer --- */
.site-footer { background-color: #e9e9e9; padding: 20px 0; margin-top: 40px; text-align: center; font-size: 0.9rem; color: #666; }
.footer-nav ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; justify-content: center; gap: 20px; }
.footer-nav a { color: #666; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

/* --- Static Content Page Styles --- */
.page-content { background-color: var(--card-bg); padding: 30px; border-radius: 8px; border: 1px solid var(--border-color); }
.page-content h1 { margin-top: 0; font-size: 2rem; }
.page-content h2 { font-size: 1.5rem; margin-top: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.page-content p, .page-content ul { line-height: 1.7; }
.page-content a { color: var(--primary-color); }

/* --- Mobile Responsive Navigation --- */
@media (max-width: 768px) {
    .nav-menu { position: fixed; left: -100%; top: 69px; flex-direction: column; background-color: var(--card-bg); width: 100%; height: calc(100vh - 69px); text-align: center; transition: 0.3s; box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05); }
    .nav-menu.active { left: 0; }
    .nav-menu li { margin: 25px 0; }
    .nav-menu a { font-size: 1.2rem; }
    .hamburger-menu { display: block; }
    .hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
    .hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}