/* Marathon de Sulta - Main Styles */

/* Custom Properties */
:root {
  --primary-color: #073D52;
  --primary-hover: #052a38;
  --secondary-color: #7c3aed;
  --success-color: #059669;
  --error-color: #dc2626;
  --warning-color: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --transition: all 0.3s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Button Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  background-color: #E94E1A;
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.125rem;
  line-height: 1.5;
}

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

.btn-primary:focus {
  outline: none;
  ring: 2px solid var(--primary-color);
  ring-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: currentColor;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius);
  border: 2px solid currentColor;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  line-height: 1.5;
}

.btn-secondary:hover {
  background-color: currentColor;
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Card Styles */
.card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-xl);
}

.hover-lift {
  transition: var(--transition);
}

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

/* Form Styles */
.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  ring: 2px solid var(--primary-color);
  ring-opacity: 0.2;
}

.input-field:invalid {
  border-color: var(--error-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

/* Sponsor Card Styles */
.sponsor-card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  text-align: center;
}

.sponsor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.sponsor-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.sponsor-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.title-sponsor {
  border: 2px solid var(--primary-color);
}

.title-sponsor .sponsor-logo-container {
  min-height: 200px;
}

.gold-sponsor {
  border: 2px solid var(--primary-color);
}

.gold-sponsor .sponsor-logo-container {
  min-height: 150px;
}

.silver-sponsor {
  border: 2px solid var(--primary-color);
}

.silver-sponsor .sponsor-logo-container {
  min-height: 100px;
}

.bronze-sponsor {
  border: 2px solid var(--primary-color);
}

.bronze-sponsor .sponsor-logo-container {
  min-height: 80px;
}

.sponsor-description {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

/* Animation Classes */
.animation-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: none;
}

.animation-transition {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animation-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Sponsor section specific animations */
.sponsor-card {
  will-change: transform, opacity;
}

.sponsor-card.animation-hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

.sponsor-card.animation-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Searchable Dropdown Styles */
.location-option {
  transition: background-color 0.2s ease;
}

.location-option:hover {
  background-color: #f3f4f6;
}

.location-option.active {
  background-color: #dbeafe;
}

#buddyLocationDropdown {
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#buddyLocationDropdown::-webkit-scrollbar {
  width: 6px;
}

#buddyLocationDropdown::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#buddyLocationDropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#buddyLocationDropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.bg-gradient-hero {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .sponsor-card {
    padding: 1rem;
  }
  
  .sponsor-logo-container {
    min-height: 80px;
  }
  
  .title-sponsor .sponsor-logo-container {
    min-height: 120px;
  }
  
  .gold-sponsor .sponsor-logo-container {
    min-height: 100px;
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  ring: 2px solid var(--primary-color);
  ring-offset: 2px;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid var(--gray-300) !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0000ff;
    --gray-600: #000000;
    --gray-700: #000000;
    --gray-800: #000000;
    --gray-900: #000000;
  }
  
  .card {
    border: 2px solid var(--gray-900);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hover-lift:hover {
    transform: none;
  }
  
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
  }
  
  body {
    background-color: var(--gray-50);
    color: var(--gray-900);
  }
  
  .card {
    background-color: var(--gray-100);
  }
  
  .input-field {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-900);
  }
}