/* ========================================
   DINEHUB HOMEPAGE - THEFORK INSPIRED
   Modern Restaurant Discovery Platform
   ======================================== */

/* ========================================
   CSS VARIABLES & DESIGN TOKENS
   ======================================== */
:root {
  /* Primary Colors */
  --primary-600: #007aff;
  --primary-700: #0051d5;
  --primary-100: rgba(0, 122, 255, 0.1);

  /* Neutral Colors */
  --gray-900: #1d1d1f;
  --gray-700: #424245;
  --gray-500: #86868b;
  --gray-300: #d2d2d7;
  --gray-100: #f5f5f7;
  --white: #ffffff;

  /* Accent Colors */
  --success: #34c759;
  --warning: #ff9500;
  --error: #ff3b30;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.main-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--primary-600);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  list-style: none;
}

.nav-link {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color var(--transition-fast);
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--primary-600);
  background: var(--primary-100);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-900);
  cursor: pointer;
  padding: 8px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  font-family: inherit;
  white-space: nowrap;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-600);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-600);
}

.btn-secondary:hover {
  background: var(--primary-100);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--primary-600);
  color: var(--primary-600);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
}

/* ========================================
   HERO SECTION WITH SEARCH
   ======================================== */
.hero-search {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-search::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 20px;
  opacity: 0.95;
  margin-bottom: var(--space-lg);
  font-weight: 400;
}

/* Search Widget */
.search-widget {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
}

.search-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  text-align: left;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--white);
  color: var(--gray-900);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input::placeholder {
  color: var(--gray-500);
}

.search-btn {
  padding: 12px 32px;
  height: 46px;
}

/* ========================================
   QUICK FILTERS
   ======================================== */
.quick-filters {
  padding: var(--space-lg) 0;
  background: var(--white);
}

.quick-filters-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--gray-900);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
  max-width: 1000px;
  margin: 0 auto;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--gray-900);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.filter-chip:hover {
  background: var(--primary-100);
  border-color: var(--primary-600);
  color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.filter-chip i {
  font-size: 20px;
}

/* ========================================
   RESTAURANT GRID
   ======================================== */
.restaurants-section {
  padding: var(--space-xl) 0;
  background: var(--gray-100);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-link {
  color: var(--primary-600);
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-base);
}

.section-link:hover {
  gap: 10px;
}

.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.restaurant-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all var(--transition-base);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.restaurant-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-600);
}

.restaurant-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--gray-100);
}

.restaurant-body {
  padding: var(--space-md);
}

.restaurant-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--space-xs);
}

.restaurant-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.restaurant-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--success);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.restaurant-cuisine {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: var(--space-xs);
}

.restaurant-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--gray-500);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--gray-300);
}

.restaurant-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.restaurant-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-top: var(--space-xs);
}

/* ========================================
   CUISINE CATEGORIES
   ======================================== */
.cuisine-section {
  padding: var(--space-xl) 0;
  background: var(--white);
}

.cuisine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.cuisine-card {
  position: relative;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.cuisine-card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.cuisine-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cuisine-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
}

.cuisine-name {
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features-section {
  padding: var(--space-xl) 0;
  background: var(--gray-100);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  text-align: center;
  padding: var(--space-lg);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-md);
  background: var(--primary-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--primary-600);
}

.feature-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--gray-900);
}

.feature-description {
  color: var(--gray-500);
  font-size: 15px;
  line-height: 1.6;
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-section {
  padding: var(--space-xl) 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  text-align: center;
}

.cta-title {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -1px;
}

.cta-subtitle {
  font-size: 20px;
  opacity: 0.95;
  margin-bottom: var(--space-lg);
}

.cta-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-white {
  background: var(--white);
  color: var(--primary-600);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   FOOTER
   ======================================== */
.main-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-column h3 {
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: var(--gray-300);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--white);
}

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
  color: var(--gray-500);
}

/* ========================================
   LOADING STATES
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, var(--gray-300) 25%, var(--gray-100) 50%, var(--gray-300) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-300);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .search-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .section-title {
    font-size: 28px;
  }

  .restaurants-grid {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-title {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-chip {
    padding: 14px 16px;
  }
}
