/* 
 * Reozip - Main Stylesheet
 * A comprehensive stylesheet for the Reozip website
 */

/* ===== VARIABLES ===== */
:root {
  --primary-color: #007bff;
  --primary-dark: #0056b3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --body-bg: #ffffff;
  --body-color: #212529;
  --border-color: #dee2e6;
  --border-radius: 0.25rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition-speed: 0.3s;
  --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 1rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-base: 1.5;
  --container-width: 1140px;
  --header-height: 70px;
  --footer-bg: #343a40;
  --footer-color: #f8f9fa;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--body-color);
  background-color: var(--body-bg);
  overflow-x: hidden;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: inherit;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--container-width);
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-2, .col-4, .col-6, .col-8, .col-12 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-2 {
  flex: 0 0 16.666667%;
  max-width: 16.666667%;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Margin and padding utilities */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }

.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* ===== COMPONENTS ===== */

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-left: 0.5rem;
}

.nav {
  display: flex;
  list-style: none;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  display: block;
  padding: 0.5rem 0;
  color: var(--secondary-color);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  text-decoration: none;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--secondary-color);
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 5rem 0;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 1.5rem;
  color: var(--secondary-color);
}

/* ZIP Count Info */
.zip-count-info {
  background-color: rgba(0, 123, 255, 0.1);
  border-radius: 4px;
  padding: 8px 15px;
  margin-top: 15px;
  display: inline-block;
  font-size: 1.1rem;
}

.zip-count-info strong {
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* Search Box */
.search-box {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 600px;
  margin: 2rem auto 0;
}

.search-title {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--dark-color);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-medium);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--body-color);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-speed) ease-in-out, box-shadow var(--transition-speed) ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-input {
  flex: 1;
}

.advanced-search-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: var(--font-weight-medium);
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: color var(--transition-speed) ease-in-out, background-color var(--transition-speed) ease-in-out, border-color var(--transition-speed) ease-in-out, box-shadow var(--transition-speed) ease-in-out;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  color: #fff;
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-primary {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-search {
  width: 100%;
  margin-top: 1rem;
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.5rem;
}

.card-title {
  margin-bottom: 1rem;
  font-weight: var(--font-weight-bold);
}

.card-text {
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.section:last-child {
  border-bottom: none;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Main Content */
.main-content {
  padding: 3rem 0;
}

/* AdSense Container */
.adsense-container {
  margin: 2rem 0;
  text-align: center;
}

.adsense-footer {
  margin-top: 3rem;
}

/* Footer */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-color);
  padding: 4rem 0 2rem;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.footer-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  transition: color var(--transition-speed) ease;
}

.footer-link:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Desktop-specific styles */
@media (min-width: 993px) {
  .container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
  }
  
  .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
    width: 100%;
  }
  
  .col-2, .col-3, .col-4, .col-6, .col-8, .col-12 {
    position: relative;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
  }
  
  /* Fix column alignment */
  .col-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
  
  .col-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  
  .col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
  
  .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Fix header alignment */
  .header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    width: 100%;
  }
  
  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  
  /* Fix card alignment */
  .card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .card-body {
    flex: 1 1 auto;
    padding: 1.5rem;
  }
  
  /* Ensure colors are properly applied on desktop */
  .btn-primary {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
  }
  
  .btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
  }
  
  .text-primary {
    color: var(--primary-color) !important;
  }
  
  .logo-text {
    color: var(--primary-color) !important;
  }
  
  .nav-link.active {
    color: var(--primary-color) !important;
  }
  
  .section-title::after {
    background-color: var(--primary-color) !important;
  }
  
  .card {
    background-color: #fff !important;
    border: 1px solid var(--border-color) !important;
  }
  
  .footer {
    background-color: var(--footer-bg) !important;
    color: var(--footer-color) !important;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }
  
  .header {
    height: auto;
    padding: 1rem 0;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: #fff;
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
  }
  
  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-item {
    margin: 0;
  }
  
  .nav-link {
    padding: 0.75rem 2rem;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .search-box {
    padding: 1.5rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .search-box {
    padding: 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .section-title {
    margin-bottom: 2rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .col-sm-6,
  .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ===== JAVASCRIPT SUPPORT ===== */
.js-hidden {
  display: none;
}

/* National Demographics Snapshot Section */
.section .card .display-4 {
  font-size: 2.5rem; /* Slightly smaller for card context */
  color: var(--primary-color);
}

.section .card-title i {
  margin-right: 0.5rem;
}

.chart-container {
  position: relative;
  margin: auto;
  height: 250px; /* Default height */
  width: 100%;   /* Default width */
}

/* Ensure cards in the snapshot section have consistent height */
.section .row .col-lg-4.mb-4 .card,
.section .row .col-md-6.mb-4 .card {
    display: flex;
    flex-direction: column;
}

.section .row .col-lg-4.mb-4 .card .card-body,
.section .row .col-md-6.mb-4 .card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes title to top, chart/text to center/bottom */
}

.section .row .col-lg-4.mb-4 .card .card-body .chart-container,
.section .row .col-md-6.mb-4 .card .card-body .chart-container {
    flex-grow: 1; /* Allows chart container to take available space */
    display: flex;
    align-items: center; /* Vertically center canvas if smaller than container */
    justify-content: center; /* Horizontally center canvas */
}

/* Responsive adjustments for chart height if needed */
@media (max-width: 992px) {
  .chart-container {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .chart-container {
    height: 200px;
  }
   .section .card .display-4 {
    font-size: 2rem;
  }
}

/* Pagination Styles */
ul.pagination { /* Make selector more specific */
  display: flex;
  flex-wrap: wrap; 
  justify-content: center;
  padding-left: 0;
  list-style-type: none !important; /* Ensure bullets are removed */
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
}

ul.pagination > li.page-item { /* Make selector more specific */
  display: inline-block; 
  margin: 0 2px; 
}

.page-item.disabled .page-link {
  color: var(--secondary-color);
  pointer-events: none;
  background-color: var(--light-color);
  border-color: var(--border-color);
}

.page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  line-height: 1.25;
  color: var(--primary-color);
  background-color: #fff;
  border: 1px solid var(--border-color);
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.page-link:hover {
  z-index: 2;
  color: var(--primary-dark);
  text-decoration: none;
  background-color: var(--light-color);
  border-color: var(--border-color);
}

.page-link:focus {
  z-index: 3;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
