/* styles.css - Enhanced Modern Design */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #f59e0b;
  --accent: #10b981;
  --danger: #ef4444;
  --dark: #0f172a;
  --darker: #020617;
  --light: #f8fafc;
  --lighter: #ffffff;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--darker);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-left: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-left: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced Header */
.site-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

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

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.top-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Hero Section - FIXED */
.hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  text-align: center;
  padding: 4rem 2rem;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

/* Enhanced Card Design */
.card {
  background: var(--lighter);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

.section-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Build Wall - Enhanced Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.grid::-webkit-scrollbar {
  width: 8px;
}

.grid::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.grid::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.grid::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.projectSquare {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 700;
  font-size: 2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.projectSquare::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.projectSquare:hover::before {
  left: 100%;
}

.projectSquare:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.projectSquare .initial {
  font-size: 2.5rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.projectSquare .meta {
  position: absolute;
  bottom: 8px;
  right: 8px;
}

/* Enhanced Tooltip */
.projectSquare .tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 220px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.projectSquare:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip .t-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.tooltip .t-link {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.25rem;
  word-break: break-all;
}

.tooltip .t-location {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Like Button Enhancement */
.like-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.like-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.like-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Enhanced Form Design */
.project-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

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

.form-control {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.color-picker-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-picker-container input[type="color"] {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.color-preview {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}

.location-container {
  position: relative;
}

.location-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.location-suggestion {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.location-suggestion:hover {
  background: var(--light);
}

.location-suggestion:last-child {
  border-bottom: none;
}

/* Enhanced Buttons */
.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-secondary {
  background: linear-gradient(135deg, var(--muted), #475569);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-text {
  transition: opacity 0.3s ease;
}

.btn-spinner {
  display: none;
}

/* Form Actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.progress-container {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  max-width: 200px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 3px;
}

/* Form Message */
.form-message {
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-weight: 500;
}

.form-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Spotlight Area */
.spotlight-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.spot-card {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.spot-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.spot-left {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.spot-right {
  flex: 1;
}

.spot-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.spot-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

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

.spot-location {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.spot-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Leaderboard */
.leader-list {
  list-style: none;
  counter-reset: leader-counter;
}

.leader-list li {
  counter-increment: leader-counter;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  background: var(--light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.leader-list li:hover {
  transform: translateX(4px);
  background: white;
}

.leader-list li::before {
  content: counter(leader-counter);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.leader-list li:nth-child(1)::before {
  background: linear-gradient(135deg, var(--secondary), #f59e0b);
}

.leader-list li:nth-child(2)::before {
  background: linear-gradient(135deg, var(--muted), #64748b);
}

.leader-list li:nth-child(3)::before {
  background: linear-gradient(135deg, var(--accent), #10b981);
}

/* Map Container */
.map-container {
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--light);
}

/* Footer */
.site-footer {
  background: var(--dark);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

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

.footer-section h3 {
  color: var(--secondary);
  margin-bottom: 1rem;
}

.footer-section h4 {
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
  color: #94a3b8;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

.slide-in {
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateX(-20px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .top-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-stats {
    gap: 1.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 400px;
  }
  
  .projectSquare {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
  
  .projectSquare .initial {
    font-size: 2rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .progress-container {
    max-width: none;
  }
  
  .map-container {
    height: 300px;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .spotlight-area {
    grid-template-columns: 1fr;
  }
}