/* ============================================
   GetWifi - Main Stylesheet
   ============================================ */

/* CSS Reset & Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--gray-800); background: var(--white); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ============ Layout ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { padding: 60px 0; }
.section:nth-child(even) { background: var(--gray-50); }

/* ============ Navbar ============ */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.navbar .container {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 16px; flex-wrap: wrap;
}
.navbar-brand { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.navbar-brand:hover { text-decoration: none; }
.logo { color: var(--primary); }
.navbar-menu { display: flex; gap: 4px; flex: 1; }
.navbar-link {
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--gray-700); font-size: 0.9rem; white-space: nowrap;
  transition: background var(--transition);
}
.navbar-link:hover { background: var(--gray-100); text-decoration: none; }
.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* Search form */
.search-form, .search-form-inline {
  display: flex; gap: 4px; align-items: center;
}
.search-input, .hero-search-input {
  padding: 8px 14px; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.9rem;
  outline: none; transition: border-color var(--transition);
  background: var(--white);
}
.search-input:focus, .hero-search-input:focus { border-color: var(--primary); }
.search-btn { padding: 8px 12px; background: var(--primary); color: white; border: none; border-radius: var(--radius); cursor: pointer; }
.search-btn:hover { background: var(--primary-dark); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: white; }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: white; padding: 80px 0;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.2rem; opacity: 0.9; margin-bottom: 40px; }
.hero-search { display: flex; gap: 8px; max-width: 600px; margin: 0 auto 40px; }
.hero-search-input {
  flex: 1; padding: 14px 20px; border-radius: var(--radius-lg);
  border: none; font-size: 1rem; box-shadow: var(--shadow-md);
}
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 800; }
.stat-label { font-size: 0.9rem; opacity: 0.8; }

/* ============ Venue Types Grid ============ */
.venue-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-top: 24px;
}
.venue-type-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 12px; background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); transition: all var(--transition);
  text-align: center; color: var(--gray-700);
}
.venue-type-card:hover {
  border-color: var(--primary); box-shadow: var(--shadow-md);
  transform: translateY(-2px); color: var(--primary); text-decoration: none;
}
.venue-type-icon { font-size: 2rem; margin-bottom: 8px; }
.venue-type-name { font-size: 0.875rem; font-weight: 500; }

/* ============ Venue Grid ============ */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin: 24px 0;
}
.venue-card {
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  overflow: hidden; transition: all var(--transition); background: white;
}
.venue-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.venue-card-link { display: block; padding: 16px; color: inherit; text-decoration: none; }
.venue-card-link:hover { text-decoration: none; }
.venue-card-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.venue-icon { font-size: 2rem; flex-shrink: 0; }
.venue-card-name { font-size: 1rem; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.venue-card-location { font-size: 0.85rem; color: var(--gray-600); }
.venue-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--gray-100); font-size: 0.85rem; color: var(--gray-600); }

/* ============ Venue Detail Page ============ */
.venue-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; margin-top: 24px; }
@media (max-width: 768px) { .venue-layout { grid-template-columns: 1fr; } }
.venue-header { margin-bottom: 32px; }
.venue-type-badge { background: var(--primary-light); color: var(--primary); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.venue-header h1 { font-size: clamp(1.5rem, 3vw, 2.5rem); margin: 12px 0 8px; }
.venue-location { color: var(--gray-600); }
.venue-location a { color: var(--gray-600); }
.venue-location a:hover { color: var(--primary); }

/* Password cards */
.passwords-section h2 { margin-bottom: 16px; }
.password-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.password-card {
  background: white; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow);
}
.password-main { margin-bottom: 12px; }
.password-network { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ssid { font-weight: 600; font-size: 1rem; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-info { background: #e0f2fe; color: var(--info); }
.password-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pwd-text { background: var(--gray-100); padding: 6px 12px; border-radius: var(--radius); font-family: monospace; font-size: 1rem; letter-spacing: 0.1em; }
.password-meta { display: flex; gap: 16px; margin-bottom: 12px; font-size: 0.85rem; color: var(--gray-600); flex-wrap: wrap; }
.vote-score.positive { color: var(--success); }
.vote-score.negative { color: var(--danger); }
.password-votes { display: flex; gap: 8px; }
.vote-btn {
  flex: 1; padding: 8px; border: 1px solid var(--gray-200);
  border-radius: var(--radius); background: white; cursor: pointer;
  font-size: 0.875rem; transition: all var(--transition); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.vote-btn.vote-up:hover, .vote-btn.vote-up.active { background: #dcfce7; border-color: var(--success); color: var(--success); }
.vote-btn.vote-down:hover, .vote-btn.vote-down.active { background: #fee2e2; border-color: var(--danger); color: var(--danger); }
.vote-count { font-weight: 700; }
.no-passwords { background: var(--gray-50); border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); padding: 32px; text-align: center; color: var(--gray-600); }

/* Add password form */
.add-password-section { margin-top: 24px; padding: 24px; background: var(--gray-50); border-radius: var(--radius-lg); }
.add-password-section h3 { margin-bottom: 16px; }

/* Sidebar cards */
.venue-sidebar { display: flex; flex-direction: column; gap: 16px; }
.venue-info-card, .nearby-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; }
.venue-info-card h3, .nearby-card h3 { margin-bottom: 12px; font-size: 1rem; color: var(--gray-700); }
.venue-info-card p { margin-bottom: 8px; font-size: 0.9rem; }
.nearby-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; }
.nearby-item:last-child { border-bottom: none; }
.nearby-name { color: var(--primary); }
.nearby-city { color: var(--gray-500); font-size: 0.8rem; }

/* ============ Country/City pages ============ */
.country-stats, .type-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.stat-box { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 24px; text-align: center; }
.stat-box a { color: inherit; }
.stat-box .stat-number { display: block; font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-box .stat-label { font-size: 0.85rem; color: var(--gray-600); }
.filter-btn { padding: 6px 16px; border: 1px solid var(--gray-200); border-radius: 20px; font-size: 0.875rem; color: var(--gray-700); background: white; transition: all var(--transition); text-decoration: none; }
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); text-decoration: none; }
.cities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.city-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; transition: all var(--transition); }
.city-card:hover { border-color: var(--primary); text-decoration: none; }
.city-name { font-weight: 600; color: var(--gray-800); }
.city-count { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* ============ Articles ============ */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin: 24px 0; }
.article-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; }
.article-card h2, .article-card h3 { margin-bottom: 8px; }
.article-card h2 a, .article-card h3 a { color: var(--gray-900); }
.article-card h2 a:hover, .article-card h3 a:hover { color: var(--primary); text-decoration: none; }
.article-category { display: inline-block; background: var(--primary-light); color: var(--primary); padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 0.85rem; color: var(--gray-500); }
.read-more { color: var(--primary); font-weight: 500; }
.article-container { max-width: 800px; }
.article-header h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin: 12px 0; }
.article-body { margin-top: 24px; line-height: 1.8; }
.article-body h2, .article-body h3 { margin: 32px 0 12px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 16px 0; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }

/* ============ Forms ============ */
.form-page { max-width: 640px; margin: 40px auto; }
.submission-form fieldset { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.submission-form legend { font-weight: 600; padding: 0 8px; color: var(--gray-700); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.9rem; outline: none; transition: border-color var(--transition); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 576px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.form-check input { width: 16px; height: 16px; cursor: pointer; }
.form-actions { margin-top: 24px; }
.form-note { font-size: 0.8rem; color: var(--gray-500); margin-top: 8px; }

/* ============ Breadcrumb ============ */
.breadcrumb { margin: 16px 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.875rem; }
.breadcrumb li:not(:last-child)::after { content: ' /'; color: var(--gray-400); margin-left: 4px; }
.breadcrumb .active { color: var(--gray-600); }
.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--primary); }

/* ============ Page headers ============ */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 8px; }
.intro-text { color: var(--gray-600); margin-top: 8px; line-height: 1.7; }
.venue-count, .results-count { color: var(--gray-600); font-size: 0.9rem; }

/* ============ How it works ============ */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }
.step { text-align: center; padding: 24px; }
.step-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--gray-600); font-size: 0.9rem; }

/* ============ Footer ============ */
.footer { background: var(--gray-900); color: var(--gray-300); padding: 60px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { color: white; font-size: 1.5rem; font-weight: 700; display: block; margin-bottom: 8px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; }
.footer-nav h4 { color: white; margin-bottom: 12px; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 8px; }
.footer-nav a { color: var(--gray-400); font-size: 0.875rem; }
.footer-nav a:hover { color: white; }
.footer-bottom { border-top: 1px solid var(--gray-700); padding-top: 24px; text-align: center; font-size: 0.8rem; color: var(--gray-500); }

/* ============ Alerts ============ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef9c3; color: #92400e; }
.alert-info { background: #e0f2fe; color: #075985; }

/* ============ Language switcher ============ */
.lang-switcher { position: relative; }
.lang-current { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.lang-dropdown { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 160px; z-index: 200; }
.lang-switcher:hover .lang-dropdown { display: block; }
.lang-option { display: block; padding: 8px 16px; font-size: 0.875rem; color: var(--gray-700); }
.lang-option:hover { background: var(--gray-50); text-decoration: none; }
.lang-option.active { color: var(--primary); font-weight: 600; }

/* ============ Search results ============ */
.results-section { margin-bottom: 40px; }
.results-section h2 { margin-bottom: 16px; }
.cities-list, .countries-list { display: flex; flex-direction: column; gap: 4px; }
.city-result, .country-result { display: flex; justify-content: space-between; padding: 10px 16px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 0.9rem; }
.city-result:hover, .country-result:hover { border-color: var(--primary); text-decoration: none; }
.count { color: var(--gray-500); font-size: 0.8rem; }
.no-results { text-align: center; padding: 60px 24px; }
.search-suggestions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ============ Pagination ============ */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 32px 0; }
.page-item .page-link { padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 0.875rem; }
.page-item.active .page-link { background: var(--primary); color: white; border-color: var(--primary); }
.page-item.disabled .page-link { color: var(--gray-400); cursor: not-allowed; }

/* ============ Utilities ============ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .navbar-menu { display: none; }
  .hero { padding: 40px 0; }
  .hero-search { flex-direction: column; }
  .venue-type-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-stats { gap: 24px; }
}

@media (max-width: 480px) {
  .venue-type-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============ FAQ Section ============ */
.faq-section { margin: 40px 0; padding: 32px; background: var(--gray-50); border-radius: var(--radius-lg); }
.faq-section > h2 { margin-bottom: 24px; font-size: 1.5rem; }
.faq-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--gray-800); cursor: pointer; }
.faq-item p { color: var(--gray-600); font-size: 0.9rem; line-height: 1.6; }

/* ============ City/Country Intro ============ */
.city-intro, .country-intro { 
  margin: 16px 0 32px; padding: 20px 24px;
  background: var(--primary-light); border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0; line-height: 1.7;
}
.city-intro p, .country-intro p { margin-bottom: 12px; }
.city-intro p:last-child, .country-intro p:last-child { margin-bottom: 0; }

/* ============ noindex warning bar (dev only) ============ */
.noindex-notice {
  background: #fef3c7; border-bottom: 2px solid #d97706;
  padding: 8px 16px; text-align: center; font-size: 0.8rem; color: #92400e;
}

/* ============ Venue rich description ============ */
.venue-rich-description { margin: 32px 0; }
.venue-rich-description h2 { font-size: 1.5rem; margin-bottom: 16px; }
.venue-rich-description h3 { font-size: 1.1rem; margin: 24px 0 10px; color: var(--gray-700); }
.venue-rich-description p { color: var(--gray-700); line-height: 1.7; margin-bottom: 14px; }
.connect-steps { margin: 12px 0 20px 20px; }
.connect-steps li { margin-bottom: 8px; color: var(--gray-700); line-height: 1.6; }
.venue-description-section { border-top: 1px solid var(--gray-200); padding-top: 32px; margin-top: 32px; }

/* ============ Country / City grid (type drill-down) ============ */
.page-subtitle { color: var(--gray-600); margin-top: 4px; font-size: 0.95rem; }
.country-grid-section, .city-grid-section, .top-venues-section { margin: 32px 0; }
.country-grid-section h2, .city-grid-section h2, .top-venues-section h2 { font-size: 1.25rem; margin-bottom: 16px; color: var(--gray-800); }
.country-grid, .city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.country-card, .city-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  background: white; color: var(--gray-800); text-decoration: none;
  font-size: 0.95rem; transition: all var(--transition);
}
.country-card:hover, .city-card:hover {
  border-color: var(--primary, #2563eb); color: var(--primary, #2563eb);
  text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.country-card-name, .city-card-name { font-weight: 500; }
.country-card-count, .city-card-count {
  color: var(--gray-500); font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
