/* ==============================
   Root Variables for Consistency
   ============================== */
:root {
  --primary: #0066cc;
  --secondary: #f9a825;
  --neutral: #222;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --card-shadow: rgba(0,0,0,0.05);
}

/* Reset and basic styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--neutral);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

/* Ensure body stretches full height */
body {
  min-height: 100vh;
}

/* Main content area */
main {
  flex: 1;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
header {
  background: var(--neutral);
  color: #fff;
  padding: 20px;
  text-align: center;
}

header img {
  height: 60px;
  margin-bottom: 10px;
}

#header-ad img {
  max-width: 100%;
  height: auto;
}

/* ==============================
   Navigation Enhancement
   ============================== */
nav {
  background: transparent;
  padding: 1em;
  border-bottom: 1px solid #e0e0e0;
  margin-top: 10px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  display: inline-block;
  background-color: #ffffff;
  color: var(--neutral);
  padding: 0.7em 1.5em;
  margin: 0.3em 0;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease-in-out;
}

nav ul li a:hover,
nav ul li a:focus-visible {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

/* ==============================
   Section & Article Cards
   ============================== */
section, article {
  background: var(--card-bg);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

section:hover, article:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

section img, article img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Headings */
h1 { font-size: 2.2rem; margin-bottom: 0.3em; font-weight: 700; }
h2 { font-size: 1.6rem; margin-top: 1.5em; }
h3 { font-size: 1.3rem; color: var(--primary); }
p { line-height: 1.6; }

/* Footer */
footer {
  background: #eaeaea;
  padding: 15px;
  text-align: center;
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Google Form Container */
.google-form-container {
  background: #fff;
  padding: 20px;
  margin: 2rem auto;
  border-radius: 10px;
  max-width: 450px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.google-form-container iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 8px;
  background-color: transparent;
}

.google-form-container h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #333;
}

/* Ad Space Section */
#ad-space {
  background: #fff8e1;
  border: 2px dashed var(--secondary);
  border-radius: 8px;
  padding: 20px;
  margin: 2rem 0;
  text-align: center;
  color: #5d4037;
}

#ad-space ul {
  list-style-type: none;
  padding-left: 0;
  margin: 1rem 0;
}

#ad-space li {
  margin: 0.5rem 0;
  font-weight: 600;
}

#rotating-ad {
  width: 468px;
  height: 60px;
  margin: 12px auto;
  overflow: hidden;
}

#rotating-ad img {
  width: 468px;
  height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Sidebar Ad */
#sidebar-ad {
  position: fixed;
  top: 150px;
  left: 10px;
  width: 300px;
  z-index: 1000;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding-top: 10px;
}

#sidebar-ad img {
  width: 100%;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

#sidebar-ad img:hover {
  opacity: 0.8;
}

#sidebar-ad .close-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  z-index: 1001;
}

/* ==============================
   Buttons & Links
   ============================== */
a[href*="http"] {
  transition: background 0.2s ease, transform 0.2s ease;
}

a[href*="http"]:hover {
  background-color: var(--primary);
  color: #fff !important;
  transform: translateY(-2px);
}

/* ==============================
   Privacy Banner
   ============================== */
#privacy-banner {
  font-size: 13px;
  padding: 10px;
  border-bottom: 2px solid var(--secondary);
}

/* ==============================
   Responsive Enhancements
   ============================== */
@media (max-width: 768px) {
  #sidebar-ad { display: none; }
}

@media (max-width: 600px) {
  nav ul { flex-direction: column; align-items: stretch; }
  nav ul li a { width: 100%; text-align: center; border-radius: 6px; background: var(--primary); color: #fff; }
}

@media (max-width: 480px) {
  body { font-size: 16px; line-height: 1.5; padding: 0 10px; }
  header, footer, nav { width: 100%; padding: 0 10px; }
  img, video, iframe { max-width: 100%; height: auto; }
  table { width: 100%; overflow-x: auto; display: block; }
  h1, h2, h3 { word-break: break-word; font-size: 1.4em; }
  nav ul { flex-direction: column; padding: 0; margin: 0; }
  nav ul li { display: block; margin: 0.5em 0; }
}
