/* ==========================================================================
PINFORK STYLES - PROFESSIONAL DESIGN SYSTEM
========================================================================== */

/* CSS Custom Properties for consistent design */
:root {
  /* Brand Colors */
  --primary-color: #e74c3c;
  --primary-hover: #c0392b;
  --primary-light: rgba(231, 76, 60, 0.1);
  --primary-dark: #a93226;

  /* Neutral Colors */
  --text-primary: #1c1e21;
  --text-secondary: #65676b;
  --text-muted: #b0b3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f2f5;
  --border-color: #e1e5e9;
  --border-light: #e9ecef;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-xxl: 1.5rem;
  --font-size-xxxl: 2rem;
  --line-height: 1.6;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Transitions */
  --transition: 0.3s ease;

  /* Layout */
  --container-max-width: 1200px;
  --nav-height: 70px;
}

/* ==========================================================================
RESET & BASE STYLES
========================================================================== */

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

body {
  font-family: var(--font-family);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  font-size: var(--font-size-base);
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ==========================================================================
HEADER & NAVIGATION
========================================================================== */

.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-brand {
  align-items: center;
  text-decoration: none;
  font-height: 24;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 30px;
  font-weight: 700;
  color: #ff0000;
  text-decoration: none;
  margin: 0;
  line-height: 1;
}

.logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.logo sup {
  font-size: 0.35em; /* Reverted to original smaller size */
  vertical-align: super;
  margin-left: 2px; /* Small space */
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md); /* Keep existing gap */
}

/* Ensure the new button has consistent height with other buttons */
.nav-actions .btn-primary {
  height: 40px; /* Match existing button height */
  padding: var(--spacing-sm) var(--spacing-md); /* Match existing button padding */
}

/* Adjust for mobile responsiveness if needed, though current media queries should handle it */
@media (max-width: 768px) {
  .nav-actions .btn-primary {
    display: none; /* Hide the button in the header on mobile, as mobile menu has its own actions */
  }
}

.auth-buttons {
  display: flex;
  gap: var(--spacing-sm);
}

/* ==========================================================================
USER MENU
========================================================================== */

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.dropdown {
  position: relative;
}

.dropdown-btn {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.dropdown-btn:hover {
  background-color: var(--bg-tertiary);
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  min-width: 150px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: var(--spacing-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color var(--transition);
  border-bottom: 1px solid var(--border-light);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background-color: var(--bg-tertiary);
}

.dropdown-content a:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.dropdown-content a:last-child {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* ==========================================================================
BUTTONS
========================================================================== */

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-base);
  border: 2px solid var(--primary-color);
  height: 40px;
}

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

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border: 2px solid #6c757d;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-base);
  height: 40px;
}

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.75rem var(--spacing-lg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-base);
}

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

/* ==========================================================================
MAIN CONTENT
========================================================================== */

.main {
  min-height: calc(100vh - var(--nav-height));
  padding-top: 4px; /* Set 4px padding for desktop */
  padding-bottom: 0; /* Keep bottom padding at 0 or adjust as needed */
}

.page {
  display: block;
}

.page.hidden {
  display: none;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width); /* Centered */
  margin-left: auto; /* Centered */
  margin-right: auto; /* Centered */
}

.page-header h2 {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
  color: var(--text-primary);
}

.home-header {
  max-width: 600px;
  margin: 0 auto 4px; /* Set 4px bottom margin for desktop */
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* ==========================================================================
COMMON CARD STYLES (Post, Restaurant, Group, Recipe)
========================================================================== */

.post-card,
.restaurant-card,
.group-card,
.recipe-card {
  background: var(--bg-primary);
  border-radius: 4px; /* Consistent border-radius */
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative; /* For overlay positioning */
}

.post-card:hover,
.restaurant-card:hover,
.group-card:hover,
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Image Container for all cards */
.post-image-container,
.restaurant-image-container,
.group-image-container,
.recipe-image-container {
  position: relative;
  width: 100%;
  height: 480px; /* Consistent height for all card images */
  overflow: hidden;
}

.post-image,
.restaurant-image,
.group-image,
.recipe-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Common Overlay for all cards */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Default: Pushes content to the bottom */
  padding: var(--spacing-md);
  color: white; /* Default text color for overlay content */
}

/* Modifier for cards that need content at top and bottom (e.g., posts) */
.card-overlay.top-bottom {
  justify-content: space-between;
}

/* Wrapper for content at the bottom of the overlay */
.card-bottom-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm); /* Space between content blocks */
}

/* Specific overlay content styling for readability */
.card-overlay h3,
.card-overlay h4 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.card-overlay p,
.card-overlay span {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-overlay .fas {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
POST CARDS - OVERLAY STYLE (Specifics)
========================================================================== */

.posts-container {
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}

.post-header-overlay {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  /* margin-bottom: auto; This was removed in previous turn, which is good */
}

.post-user-info-overlay {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.post-user-details {
  color: white;
}

.post-user-details h4 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.post-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-top: 0.125rem;
}

.restaurant-badge {
  color: var(--primary-color);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.follow-btn-overlay {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.25rem var(--spacing-sm);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.follow-btn-overlay:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.post-content-overlay {
  color: white;
}

.post-title-overlay {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.post-description-overlay {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-location-overlay {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--spacing-sm);
}

.post-location-overlay i {
  color: var(--primary-color);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.post-actions-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-actions-left-overlay {
  display: flex;
  gap: var(--spacing-md);
}

.action-btn-overlay {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 0.2);
  color: white;
  padding: 0.375rem var(--spacing-sm);
  border-radius: var(--radius-xl);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-btn-overlay:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.action-btn-overlay.liked {
  background: rgba(231, 76, 60, 0.8);
  border-color: rgba(231, 76, 60, 0.9);
  color: white;
}

.action-btn-overlay.favorited {
  background: #ffd700; /* Gold highlight for favorite */
  color: #222;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.2s, color 0.2s;
}
.action-btn-overlay.favorited i {
  color: #222;
}

.priority-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: var(--primary-color);
  color: white;
  padding: 0.25rem var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.priority-badge.nearby {
  background: #17a2b8;
}

.priority-badge.sponsored {
  background: #6f42c1;
}

/* ==========================================================================
RESTAURANT CARDS (Specifics)
========================================================================== */

.restaurants-container {
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px; /* Changed from var(--spacing-xl) to 2px */
}

/* Styles for content within the overlay */
.restaurant-header-overlay {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.restaurant-name-overlay {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0;
}

.restaurant-distance-overlay {
  font-size: var(--font-size-sm);
}

.rating-container-overlay {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.stars-overlay {
  color: #ffc107;
}

.rating-number-overlay {
  font-weight: 600;
}

.review-count-overlay {
  font-size: var(--font-size-sm);
}

.restaurant-meta-overlay {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.cuisine-badge-overlay {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  padding: 0.25rem var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.price-range-overlay {
  font-weight: 600;
  color: var(--primary-color); /* Keep brand color for price */
}

.restaurant-address-overlay {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

/* ==========================================================================
GROUPS CARDS (Specifics)
========================================================================== */

.groups-container {
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px; /* Changed from var(--spacing-xl) to 2px */
}

/* Styles for content within the overlay */
.group-header-overlay {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.group-name-overlay {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0;
}

.group-privacy-overlay {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.group-privacy-overlay.public {
  background: #10b981;
}

.group-description-overlay {
  margin-bottom: var(--spacing-xs); /* Reduced margin */
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-stats-overlay {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.group-stat-overlay {
  text-align: center;
}

.stat-number-overlay {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.stat-label-overlay {
  font-size: var(--font-size-sm);
}

.group-creator-overlay {
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.group-actions-overlay {
  display: flex;
  gap: var(--spacing-sm);
}

/* ==========================================================================
SEARCH & FILTERS
========================================================================== */

.search-container {
  max-width: 600px;
  margin: 0 auto var(--spacing-xl);
  padding: 0 var(--spacing-md);
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-input {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  outline: none;
  transition: all var(--transition);
  background: var(--bg-primary);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width); /* Centered */
  margin-left: auto; /* Centered */
  margin-right: auto; /* Centered */
}

.filter-select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  outline: none;
  transition: all var(--transition);
  background: var(--bg-primary);
}

.filter-select:focus {
  border-color: var(--primary-color);
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ==========================================================================
RECIPE CARDS (Specifics)
========================================================================== */

.recipes-container {
  padding: 0 var(--spacing-md);
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px; /* Changed from var(--spacing-xl) to 2px */
}

/* Styles for content within the overlay */
.recipe-title-overlay {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0 0 var(--spacing-xs) 0; /* Reduced margin */
}

.recipe-meta-overlay {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs); /* Reduced margin */
}

.recipe-rating-overlay,
.recipe-time-overlay {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-sm);
}

.recipe-description-overlay {
  margin-bottom: var(--spacing-xs); /* Reduced margin */
  line-height: 1.5;
}

.recipe-author-overlay {
  font-size: var(--font-size-sm);
}

/* ==========================================================================
FORMS & MODALS
========================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-md); /* Adjusted for cleaner look */
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--font-size-xl);
}

.close-btn {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.close-btn:hover {
  background-color: var(--bg-tertiary);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color); /* Changed to 1px solid */
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  outline: none;
  transition: all var(--transition);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.form-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  align-items: center; /* Align items for the auth switch and button */
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.auth-form,
.post-form {
  padding: var(--spacing-lg);
}

/* Auth switch styling */
.auth-switch {
  flex-grow: 1; /* Allow it to take available space */
  text-align: left; /* Align to left */
  margin-top: 0; /* Remove margin-top */
  padding: 0; /* Remove padding */
  border-top: none; /* Remove border-top */
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Password requirements styling */
.password-requirements {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.password-requirements ul {
  margin: 0; /* Remove default margin */
  padding-left: 0; /* Remove default padding */
  list-style: none; /* Remove bullet points */
}

.password-requirement-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  transition: color 0.2s ease-in-out;
}

.password-requirement-item:last-child {
  margin-bottom: 0;
}

.password-requirement-item .icon {
  color: var(--text-muted); /* Default color for unchecked */
  font-size: 0.85rem; /* Adjust icon size */
  transition: color 0.2s ease-in-out;
}

.password-requirement-item.valid {
  color: #10b981; /* Green for valid */
}

.password-requirement-item.valid .icon {
  color: #10b981; /* Green checkmark */
}

.password-match-message {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #ef4444; /* Red for mismatch */
}

.password-match-message.valid {
  color: #10b981; /* Green for match */
}

/* Password input container styles */
.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-container input {
  flex: 1;
  padding-right: 50px; /* Make room for the toggle button */
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.password-toggle i {
  font-size: 16px;
}

/* ==========================================================================
FOOTER
========================================================================== */

.footer {
  background: var(--text-primary);
  color: #e4e6ea;
  padding: var(--spacing-xxl) 0 var(--spacing-lg);
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--spacing-sm);
}

.footer-section ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
}

.social-links a {
  color: var(--text-muted);
  font-size: var(--font-size-xl);
  transition: color var(--transition);
}

.social-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-xl);
  border-top: 1px solid #3a3b3c;
  color: var(--text-muted);
}

/* ==========================================================================
UTILITY CLASSES
========================================================================== */

.hidden {
  display: none !important;
}

.loading-indicator,
.loading-more {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-secondary);
  font-style: italic;
}

.end-of-content {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  font-style: italic;
  border-top: 1px solid var(--border-light);
  margin-top: var(--spacing-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.empty-state {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--text-secondary);
}

.empty-state h3 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.empty-state p {
  font-size: var(--font-size-lg);
  line-height: 1.5;
}

.display-name-status {
  min-height: 1.2em;
  font-weight: 500;
}
.display-name-status .available {
  color: green;
}
.display-name-status .unavailable {
  color: red;
}

/* ==========================================================================
MOBILE NAVIGATION
========================================================================== */

.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.hamburger-menu:hover {
  background-color: var(--bg-tertiary);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: var(--text-secondary);
  margin: 2px 0;
  transition: var(--transition);
  border-radius: 1px;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-nav-menu {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100%;
  background: var(--bg-primary);
  z-index: 1000;
  transition: right var(--transition);
  overflow-y: auto;
  padding: var(--spacing-xl) var(--spacing-lg);
  box-shadow: var(--shadow-lg);
}

.mobile-nav-menu.active {
  right: 0;
}

.mobile-nav-menu .nav-link {
  display: block;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition);
}

.mobile-nav-menu .nav-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.mobile-nav-menu .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.mobile-auth-section {
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
}

.mobile-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.mobile-auth-buttons .btn-primary,
.mobile-auth-buttons .btn-secondary {
  width: 100%;
  justify-content: center;
}

.mobile-user-section {
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.mobile-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e74c3c;
  color: white;
  font-size: 20px;
  border: 2px solid white;
}

.mobile-user-name {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
RESPONSIVE DESIGN
========================================================================== */

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

  .auth-buttons {
    display: none;
  }

  .user-menu {
    display: none;
  }

  .hamburger-menu {
    display: flex;
  }

  .mobile-nav-overlay.active {
    display: block;
  }

  .post-image,
  .restaurant-image,
  .group-image,
  .recipe-image {
    height: 100%; /* Ensure image fills container */
  }

  .post-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: stretch;
  }

  .post-actions-left {
    justify-content: space-around;
  }

  .restaurant-card-content {
    flex-direction: column;
  }

  .restaurant-image {
    width: 100%;
    height: 200px; /* Revert to smaller height for mobile restaurant cards if needed */
  }

  .form-row {
    flex-direction: column;
  }

  .password-toggle {
    padding: 10px; /* Slightly larger touch target on mobile */
  }

  .password-toggle i {
    font-size: 18px; /* Slightly larger icon on mobile */
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .main {
    padding-top: 0; /* Remove top padding on mobile */
    padding-bottom: var(--spacing-sm); /* Keep some bottom padding */
  }

  .posts-container,
  .restaurants-container,
  .groups-container,
  .recipes-container {
    padding: 0 2px; /* Reduce side padding to match gap */
  }

  .posts-grid,
  .restaurants-grid,
  .groups-grid,
  .recipes-grid {
    grid-template-columns: 1fr; /* Make cards full width on mobile */
    gap: 2px; /* Set gap to 2px for both vertical and horizontal */
  }

  .post-card,
  .restaurant-card,
  .group-card,
  .recipe-card {
    margin-bottom: 0; /* Remove margin-bottom as gap handles it */
    border-radius: 4px; /* Reduce border-radius for a more filled look */
  }

  .post-image-container,
  .restaurant-image-container,
  .group-image-container,
  .recipe-image-container {
    height: 480px; /* Set mobile height to match desktop */
  }

  /* Condense header white space */
  .header .container {
    height: 50px; /* Reduced header height for mobile */
  }

  .home-header {
    margin-bottom: 0; /* Remove bottom margin on mobile */
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: var(--font-size-lg);
  }

  .posts-container,
  .restaurants-container,
  .groups-container,
  .recipes-container {
    padding: 0 var(--spacing-sm);
  }

  .post-card,
  .restaurant-card,
  .group-card,
  .recipe-card {
    margin-bottom: var(--spacing-lg);
  }

  .mobile-nav-menu {
    width: 100%;
    right: -100%;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .posts-container,
  .restaurants-container,
  .groups-container,
  .recipes-container {
    padding: 0 2px; /* Ensure consistent padding for smaller mobile screens */
  }
}

/* ==========================================================================
PERFORMANCE OPTIMIZATIONS
========================================================================== */

.post-card,
.restaurant-card,
.group-card,
.recipe-card,
.modal-content {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .nav-menu,
  .hamburger-menu,
  .mobile-nav-menu,
  .modal,
  .footer {
    display: none !important;
  }
}
