/* Modern Climbing Database - Clean & Minimal Design */

/* CSS Variables - Light Mode */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables - Muted Theme */
[data-theme="dark"] {
  --primary-color: #6b7280;
  --primary-hover: #4b5563;
  --background: #111827;
  --surface: #1f2937;
  --text-primary: #d1d5db;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #374151;
  --border-light: #4b5563;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6);
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

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

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

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

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

header .container:hover {
  box-shadow: var(--shadow-md);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.header-title {
  flex: 1;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

header h1 a {
  color: var(--primary-color);
  text-decoration: none;
}

header h1 a:hover {
  text-decoration: none;
  color: var(--primary-hover);
}

header h2 {
  margin: 8px 0 0 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Navigation */
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

nav a:hover {
  background: var(--border-light);
  color: var(--text-primary);
  text-decoration: none;
}

nav a.current {
  background: var(--primary-color);
  color: white;
}

nav a.current:hover {
  background: var(--primary-hover);
  color: white;
}

/* Main Content */
main {
  margin-bottom: 40px;
}

/* Main Page Headers */
main h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 40px 0;
  text-align: center;
}

/* Section Headers */
main h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 40px 0 24px 0;
  text-align: center;
}

/* View All Links */
.view-all-link {
  text-align: center;
  margin: 24px 0 40px 0;
}

.view-all-link .link {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.view-all-link .link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

/* Grid Layouts */
.climbs-grid,
.athletes-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

@media (max-width: 640px) {
  .climbs-grid,
  .athletes-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Cards */
climb,
athlete,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

climb:hover,
athlete:hover,
.card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

/* Card Headers */
climb h2,
athlete h2 {
  margin: 0 0 16px 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

climb h2 a,
athlete h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

climb h2 a:hover,
athlete h2 a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Card Content */
climb b,
athlete b {
  color: var(--text-primary);
  font-weight: 600;
}

/* Lists */
climb ul,
athlete ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}

climb li,
athlete li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

climb li:last-child,
athlete li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

climb li:first-child,
athlete li:first-child {
  padding-top: 0;
}

/* Athlete Details */
.athlete-details, .climb-details {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.athlete-details b, .climb-details b {
  color: var(--text-primary);
}

/* Ascents Sections */
.ascents-section {
  margin-bottom: 20px;
}

.ascents-section h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Search */
.search-container {
  margin-bottom: 32px;
  text-align: center;
}

#athlete-search,
#climb-search {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

#athlete-search:focus,
#climb-search:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

#athlete-search::placeholder,
#climb-search::placeholder {
  color: var(--text-muted);
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}





/* Error & Loading States */
.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  margin: 20px 0;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}



/* Detail Page Components */

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
}

.page-header h1 {
  margin: 0;
}

.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-add:hover {
  background: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: scale(1.1);
}

/* Card specific styles */
.card {
  padding: 32px;
  margin-bottom: 24px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.athlete-fields,
.climb-fields {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 3px solid var(--primary-color);
  margin-bottom: 20px;
  background: var(--border-light);
  padding: 15px;
  border-radius: var(--radius);
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-section h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  background: var(--primary-color);
  color: white;
}

.btn:hover {
  background: var(--primary-hover);
  color: white;
  text-decoration: none;
}

.btn.btn-secondary {
  background: var(--border);
  color: var(--text-primary);
}

.btn.btn-secondary:hover {
  background: var(--border-light);
}

.btn.btn-success {
  background: #10b981;
}

.btn.btn-success:hover {
  background: #059669;
}

.btn.btn-danger {
  background: #ef4444;
}

.btn.btn-danger:hover {
  background: #dc2626;
}



/* Review Page Styles */
.review-summary {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.review-section {
  margin-bottom: 48px;
}

.review-section h2 {
  margin-bottom: 24px;
  color: var(--text-primary);
}

.pending-grid {
  display: grid;
  gap: 24px;
}

.pending-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pending-details {
  margin-bottom: 20px;
}

.pending-details p {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.pending-details strong {
  color: var(--text-primary);
}

.pending-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shared-password {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  width: 100%;
  min-width: 150px;
}

.shared-password:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgb(37 99 235 / 0.1);
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.action-form {
  display: inline-flex;
  align-items: center;
}

.cannot-approve {
  opacity: 0.8;
  border-left: 4px solid var(--text-muted);
}

.approval-warning {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 8px 0;
  padding: 8px;
  background: var(--border-light);
  border-radius: 6px;
}

.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}

.btn.disabled:hover {
  transform: none;
  opacity: 0.5;
}

/* Success/Error Messages */
.success-message,
.error-message {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
}

.success-message {
  border-color: #10b981;
  background: #f0fdf4;
}

.success-message h2 {
  color: #10b981;
  margin-bottom: 16px;
}

.error-message {
  border-color: #ef4444;
  background: #fef2f2;
}

.error-message h2 {
  color: #ef4444;
  margin-bottom: 16px;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.toast {
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  cursor: pointer;
  transition: var(--transition);
}

.toast:hover {
  opacity: 0.9;
  transform: translateX(-5px);
}

.toast.success {
  background: #10b981;
}

.toast.error {
  background: #ef4444;
}

.toast.info {
  background: var(--primary-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
}

.profile-info {
  flex: 1;
}

.profile-details {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.profile-details a {
  color: var(--primary-color);
}

/* Grade Badges */
.grade-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--border-light);
  color: var(--text-primary);
  white-space: nowrap;
}

.grade-badge.large {
  font-size: 1.5rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--primary-color);
  color: white;
  margin-bottom: 16px;
  display: inline-block;
}

.grade-badge.boulder-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.grade-badge.sport-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

/* Statistics */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.stat-card {
  text-align: center;
  padding: 20px 16px;
  background: var(--border-light);
  border-radius: var(--radius);
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--border);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Section Titles */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 24px 0;
  text-align: center;
}

/* Grid Layout for Detail Pages */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Profile and Climb Names */
.profile-name,
.climb-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.profile-name a,
.climb-name a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.profile-name a:hover,
.climb-name a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Text Utilities */
.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-30 {
  margin-bottom: 30px;
}

/* Links in Cards */
.link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.web-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.85rem;
}

.web-link:hover {
  text-decoration: underline;
}

/* Responsive Design for Detail Pages */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  header .container {
    padding: 20px 24px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 20px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  nav {
    gap: 4px;
    justify-content: center;
  }
  
  nav a {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  climb,
  athlete {
    padding: 20px;
  }
  
  main h1 {
    font-size: 1.75rem;
    margin: 0 0 32px 0;
  }
  
  main h2 {
    font-size: 1.3rem;
    margin: 0 0 20px 0;
  }
  
  /* Detail page responsive styles */
  .card {
    padding: 24px;
    margin-bottom: 20px;
  }
  
  .profile-header {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
  }
  
  .profile-details {
    font-size: 1rem;
  }
  
  .grade-badge.large {
    font-size: 1.25rem;
    padding: 10px 16px;
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.85rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .section-title {
    font-size: 1.3rem;
    margin: 20px 0 20px 0;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
  }
  
  .grade-badge.large {
    font-size: 1.1rem;
    padding: 8px 12px;
  }
}