/* ==========================================================================
   Shared Table - Core Design System & Styling Foundation
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Outfit:wght@100..900&display=swap');

:root {
  /* Color Palette */
  --bg-app: #FAF6F0;                /* Warm cream background */
  --bg-card: #FFFFFF;               /* Card backgrounds */
  
  --primary: #9E4522;               /* Rich terracotta */
  --primary-hover: #7F3619;         /* Darker terracotta for hover states */
  --primary-light: #F8ECE7;         /* Soft warm highlight */
  
  --text-dark: #2A1F1B;             /* Elegant charcoal/dark brown */
  --text-muted: #73645E;            /* Warm muted grey */
  
  --border-light: #EBE0D7;          /* Soft border for cards and inputs */
  --input-bg: #FAF5F2;              /* Warm input background */
  
  --success-bg: #E8F4EE;            /* Soft green badge background */
  --success-text: #286043;          /* Darker sage green for ratings text */
  --accent-tag-bg: #EAECE6;         /* Light greyish green for category tags */
  --accent-tag-text: #3D483A;       /* Text for category tags */
  
  /* Fonts */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Spacing (Rem-based) */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;
  
  /* Borders and Shadow Defaults */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-round: 50%;
  
  --shadow-sm: 0 2px 4px rgba(42, 31, 27, 0.04);
  --shadow-md: 0 4px 16px rgba(42, 31, 27, 0.08);
  --shadow-lg: 0 8px 32px rgba(42, 31, 27, 0.12);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* Utility Layout Wrappers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header styling */
header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

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

.nav-menu {
  display: flex;
  gap: 2.25rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

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

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

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--radius-round);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Main content */
main {
  padding: var(--space-xl) 0;
  flex: 1;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  text-transform: none;
  margin-bottom: 0.75rem;
}

.badge-accent {
  background-color: var(--accent-tag-bg);
  color: var(--accent-tag-text);
}

/* Next Gathering Card */
.gathering-card {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.gathering-image {
  flex: 1.1;
  min-height: 400px;
  position: relative;
}

.gathering-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gathering-info {
  flex: 0.9;
  padding: var(--space-xxl) var(--space-xxl) var(--space-xxl) var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gathering-info h1 {
  font-size: 2.25rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.gathering-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.75rem;
}

.gathering-details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.gathering-details li {
  display: flex;
  align-items: center;
}

.detail-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-round);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.detail-text {
  margin-left: 1rem;
  display: flex;
  flex-direction: column;
}

.detail-text label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.detail-text span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
}

.gathering-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(158, 69, 34, 0.25);
}

.btn-link {
  color: var(--primary);
  font-weight: 600;
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  transition: all var(--transition-fast);
}

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

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2.25rem;
  align-items: start;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

/* Rating Form Card */
.rating-card h2 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
  line-height: 1.4;
}

.rating-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"] {
  background-color: var(--input-bg);
  border: 1px solid var(--border-light);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group select {
  cursor: pointer;
  appearance: none; /* Remove default browser arrow styling */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2373645E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="url"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(158, 69, 34, 0.1);
  background-color: #FFFFFF;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.slider-value {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Custom styled range slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
  margin: 0.75rem 0 0.25rem 0;
}

.range-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border-light);
  border-radius: 2px;
}

.range-slider::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: var(--radius-round);
  background: var(--primary);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -8px;
  transition: transform 0.1s ease, background-color var(--transition-fast);
  box-shadow: 0 2px 4px rgba(42, 31, 27, 0.15);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background-color: var(--primary-hover);
}

.range-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border-light);
  border-radius: 2px;
}

.range-slider::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border: none;
  border-radius: var(--radius-round);
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.1s ease, background-color var(--transition-fast);
  box-shadow: 0 2px 4px rgba(42, 31, 27, 0.15);
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  background-color: var(--primary-hover);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 0.1rem;
}

.btn-outline {
  background-color: #FFFFFF;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  width: 100%;
  margin-top: 0.5rem;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(158, 69, 34, 0.15);
}

/* Leaderboard Card */
.leaderboard-card {
  padding: var(--space-xl);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.card-header h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.header-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
}

.text-small {
  font-size: 0.85rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table td {
  padding: 1.15rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.venue-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.venue-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.host-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.leaderboard-table td:nth-child(2) {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--success-bg);
  color: var(--success-text);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
}

/* Footer Section */
footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 2.25rem 0;
  margin-top: auto;
}

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

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-left .logo {
  font-size: 1.5rem;
}

.text-muted {
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 1.75rem;
}

.footer-right a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer-right a:hover {
  color: var(--primary);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xxl: 2rem;
  }
  
  header {
    padding: 1rem 0;
  }
  
  .nav-menu {
    display: none; /* Simple responsive navigation helper - menu can be hidden or collapsed */
  }
  
  .gathering-card {
    flex-direction: column;
  }
  
  .gathering-image {
    min-height: 250px;
    height: 250px;
  }
  
  .gathering-info {
    padding: 1.75rem;
  }
  
  .gathering-info h1 {
    font-size: 1.75rem;
  }
  
  .card {
    padding: 1.75rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-right {
    justify-content: center;
  }
}

#gathering-location-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
  transition: color var(--transition-fast);
}

#gathering-location-link:hover {
  color: var(--primary-hover);
}

/* Rating Popover styling */
.rating-popover {
  position: absolute;
  z-index: 100;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  min-width: 210px;
  animation: popoverFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.popover-title {
  font-size: 0.725rem;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem;
}

.popover-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.825rem;
  color: var(--text-dark);
}

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

.popover-label {
  font-weight: 500;
}

.popover-score {
  font-weight: 650;
  color: var(--primary);
}

.rating-badge-clickable {
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.rating-badge-clickable:hover {
  transform: scale(1.05);
}


