/* ============================================================
   FreeAdForum.com — Main Stylesheet
   Design: Digital Marketplace Hub
   Colors: Navy #1a2744 | Orange #FF6B00 | White #FFFFFF
   Fonts: Oswald (headings) + Open Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a2744;
  --navy-dark: #111c33;
  --navy-light: #243358;
  --orange: #FF6B00;
  --orange-dark: #e05e00;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #e9ecef;
  --mid-gray: #6c757d;
  --dark-gray: #343a40;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.18);
  --radius: 6px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--dark-gray); background: var(--off-white); line-height: 1.6; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  background: var(--navy-dark);
  color: #aab4c8;
  font-size: 12px;
  padding: 5px 0;
  text-align: center;
}
.top-bar a { color: var(--orange); }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  font-family: var(--font-heading);
}
.logo-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}
.logo-text span { color: var(--orange); }
.logo-tagline { font-size: 10px; color: #aab4c8; display: block; font-weight: 400; }

/* Header Search */
.header-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  gap: 0;
}
.header-search input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px;
  outline: none;
  font-family: var(--font-body);
}
.header-search button {
  background: var(--orange);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.header-search button:hover { background: var(--orange-dark); }

/* Header Nav */
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a {
  color: #ccd6f0;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: all 0.2s;
  white-space: nowrap;
}
.header-nav a:hover, .header-nav a.active {
  background: var(--navy-light);
  color: var(--white);
}
.header-nav .btn-optin {
  background: var(--orange);
  color: white !important;
  font-weight: 600;
}
.header-nav .btn-optin:hover { background: var(--orange-dark) !important; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   BANNER AD ZONES
   ============================================================ */
.ad-zone {
  text-align: center;
  padding: 8px 0;
  background: #fff;
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
}
.ad-zone-top { background: #fff8f0; }
.ad-zone-label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.ad-zone-inner { display: inline-block; }

.ad-zone-sidebar {
  margin-bottom: 20px;
  text-align: center;
}
.ad-zone-sidebar .ad-zone-label { margin-bottom: 6px; }

.ad-zone-bottom {
  background: #fff8f0;
  padding: 12px 0;
  margin-top: 20px;
  border-top: 2px solid var(--light-gray);
}

/* ============================================================
   MAIN LAYOUT — CONTENT + SIDEBAR
   ============================================================ */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  align-items: start;
}
.page-content { min-width: 0; }
.page-sidebar { position: sticky; top: 80px; }

/* ============================================================
   HERO / HOMEPAGE BANNER
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #2d4a8a 100%);
  color: white;
  padding: 40px 0 30px;
  text-align: center;
}
.hero-section h1 {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.hero-section h1 span { color: var(--orange); }
.hero-section p {
  font-size: 16px;
  color: #ccd6f0;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search {
  display: flex;
  max-width: 600px;
  margin: 0 auto 20px;
  gap: 0;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 16px;
  outline: none;
  font-family: var(--font-body);
}
.hero-search button {
  background: var(--orange);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  transition: background 0.2s;
}
.hero-search button:hover { background: var(--orange-dark); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--orange);
  display: block;
}
.hero-stat .lbl { font-size: 12px; color: #aab4c8; }

/* ============================================================
   CATEGORY ICON GRID
   ============================================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--orange);
  display: inline-block;
}
.section-wrap { padding: 28px 0; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.category-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--dark-gray);
  transition: all 0.2s;
  box-shadow: var(--shadow);
  display: block;
}
.category-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--navy);
}
.category-card .cat-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}
.category-card .cat-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.category-card .cat-count {
  font-size: 11px;
  color: var(--mid-gray);
  margin-top: 4px;
  display: block;
}

/* ============================================================
   DIRECTORY LISTING CARDS
   ============================================================ */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.listing-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.listing-card:hover { box-shadow: var(--shadow-lg); }
.listing-card-header { display: flex; align-items: flex-start; gap: 12px; }
.listing-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.listing-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}
.listing-url {
  font-size: 11px;
  color: var(--green);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}
.listing-desc {
  font-size: 13px;
  color: var(--mid-gray);
  line-height: 1.5;
}
.listing-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-free { background: #dcfce7; color: var(--green); }
.badge-paid { background: #fef3c7; color: var(--amber); }
.badge-freemium { background: #e0f2fe; color: #0369a1; }
.badge-cat { background: #ede9fe; color: #7c3aed; }
.badge-hot { background: #fee2e2; color: var(--red); }
.listing-actions { margin-top: auto; }
.btn-visit {
  display: inline-block;
  background: var(--orange);
  color: white;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
}
.btn-visit:hover { background: var(--orange-dark); color: white; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  background: white;
  border-bottom: 1px solid var(--light-gray);
  padding: 8px 0;
  font-size: 13px;
}
.breadcrumb a { color: var(--navy); }
.breadcrumb span { color: var(--mid-gray); margin: 0 6px; }

/* ============================================================
   PAGE HEADER (category/listing pages)
   ============================================================ */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  padding: 28px 0 22px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
}
.page-header p { color: #ccd6f0; font-size: 14px; max-width: 600px; }

/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */
.sidebar-widget {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.widget-body { padding: 14px; }
.widget-links a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--light-gray);
  font-size: 13px;
  color: var(--dark-gray);
  transition: color 0.2s;
}
.widget-links a:last-child { border-bottom: none; }
.widget-links a:hover { color: var(--orange); padding-left: 4px; }
.widget-links a::before { content: '▸ '; color: var(--orange); font-size: 10px; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--navy-dark);
  color: #aab4c8;
  padding: 40px 0 0;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px;
}
.footer-brand .logo-text { color: white; font-size: 20px; }
.footer-brand p {
  font-size: 13px;
  color: #8899bb;
  margin-top: 10px;
  line-height: 1.6;
}
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: #8899bb;
  padding: 3px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  background: #0d1526;
  padding: 14px 16px;
  text-align: center;
  font-size: 12px;
  color: #556688;
}
.footer-bottom a { color: #7a8fb0; }
.footer-bottom a:hover { color: var(--orange); }
.footer-disclaimer {
  background: #0f1a30;
  border-top: 1px solid #1e2d4a;
  padding: 12px 16px;
  text-align: center;
  font-size: 11px;
  color: #556688;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================================
   EXIT POP (inline, not popup)
   ============================================================ */
#exit-pop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 18, 40, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
#exit-pop.visible { display: flex; }
.exit-pop-box {
  background: white;
  border-radius: 10px;
  max-width: 480px;
  width: 90%;
  padding: 36px 32px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.exit-pop-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 22px;
  cursor: pointer;
  color: var(--mid-gray);
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
}
.exit-pop-close:hover { color: var(--red); }
.exit-pop-icon { font-size: 40px; margin-bottom: 12px; }
.exit-pop-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.exit-pop-text {
  font-size: 14px;
  color: var(--mid-gray);
  margin-bottom: 20px;
  line-height: 1.6;
}
.exit-pop-cta {
  display: inline-block;
  background: var(--orange);
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-heading);
  text-decoration: none;
  transition: background 0.2s;
  margin-bottom: 10px;
}
.exit-pop-cta:hover { background: var(--orange-dark); color: white; }
.exit-pop-dismiss {
  display: block;
  font-size: 12px;
  color: var(--mid-gray);
  cursor: pointer;
  margin-top: 8px;
  background: none;
  border: none;
  text-decoration: underline;
}

/* ============================================================
   SEARCH RESULTS PAGE
   ============================================================ */
.search-results-header {
  background: white;
  border-bottom: 1px solid var(--light-gray);
  padding: 16px 0;
}
.search-results-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--navy);
}
.search-results-header span { color: var(--orange); }
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--mid-gray);
}
.no-results .icon { font-size: 48px; margin-bottom: 12px; }

/* ============================================================
   TABLE STYLE (for some listing pages)
   ============================================================ */
.dir-table { width: 100%; border-collapse: collapse; background: white; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.dir-table th { background: var(--navy); color: white; padding: 10px 14px; text-align: left; font-family: var(--font-heading); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.dir-table td { padding: 10px 14px; border-bottom: 1px solid var(--light-gray); font-size: 13px; vertical-align: middle; }
.dir-table tr:last-child td { border-bottom: none; }
.dir-table tr:hover td { background: #f0f4ff; }
.dir-table a { color: var(--navy); font-weight: 600; }
.dir-table a:hover { color: var(--orange); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-body { background: #f0f2f5; }
.admin-header {
  background: var(--navy-dark);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
  width: 220px;
  background: var(--navy);
  padding: 20px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  color: #aab4c8;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: var(--navy-light);
  color: white;
  border-left-color: var(--orange);
}
.admin-sidebar .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #556688;
  padding: 16px 20px 4px;
  font-weight: 600;
}
.admin-main { flex: 1; padding: 24px; overflow: auto; }
.admin-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.admin-card h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--light-gray);
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--orange); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--mid-gray); margin-top: 4px; }
.btn-primary {
  background: var(--orange);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary {
  background: var(--navy);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--navy-light); }
.alert-success {
  background: #dcfce7;
  color: var(--green);
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.code-preview {
  background: #1e2d4a;
  color: #a8d8a8;
  padding: 14px;
  border-radius: var(--radius);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
  margin-top: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-section h1 { font-size: 28px; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; width: 100%; max-width: 100%; }
  .header-nav { display: none; }
  .header-nav.open { display: flex; flex-direction: column; width: 100%; order: 4; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .listing-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
}
