/* Main CSS for Ruck Sack Run PHP Application */
/* Based on Tailwind CSS design system */

/* CSS Custom Properties (Variables) */
:root {
  --background: hsl(210, 40%, 98%);
  --foreground: hsl(222.2, 84%, 4.9%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(222.2, 84%, 4.9%);
  --popover: hsl(0, 0%, 100%);
  --popover-foreground: hsl(222.2, 84%, 4.9%);
  --primary: hsl(221.2, 83.2%, 53.3%);
  --primary-rgb: 59, 130, 246;
  --primary-foreground: hsl(210, 40%, 98%);
  --secondary: hsl(43.3, 96.4%, 56.3%);
  --secondary-foreground: hsl(222.2, 84%, 4.9%);
  --muted: hsl(210, 40%, 96%);
  --muted-foreground: hsl(215.4, 16.3%, 46.9%);
  --accent: hsl(43.3, 96.4%, 56.3%);
  --accent-rgb: 245, 158, 11;
  --accent-foreground: hsl(222.2, 84%, 4.9%);
  --destructive: hsl(0, 84.2%, 60.2%);
  --destructive-foreground: hsl(210, 40%, 98%);
  --border: hsl(214.3, 31.8%, 91.4%);
  --input: hsl(214.3, 31.8%, 91.4%);
  --ring: hsl(221.2, 83.2%, 53.3%);
  --radius: 0.5rem;
  
  /* Typography */
  --font-sans: "Inter", sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: Menlo, monospace;
  
  /* Layout */
  --header-height: 96px; /* Dynamic value, updated by JavaScript */
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

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

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.section-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Header Styles */
.header-main {
  background-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.header-brand {
  color: var(--primary-foreground);
}

.brand-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}

/* Dropdown Navigation */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--primary-foreground);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.nav-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.nav-dropdown-trigger.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent);
}

.nav-dropdown-trigger .dropdown-icon {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-trigger .dropdown-icon {
  transform: rotate(180deg);
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
}

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

.dropdown-item:hover {
  background: var(--muted);
  color: var(--primary);
}

.dropdown-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.dropdown-item .dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-link {
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--accent);
  background-color: rgba(255, 255, 255, 0.1);
}

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

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.hamburger {
  width: 1.5rem;
  height: 2px;
  background-color: var(--primary-foreground);
  transition: all 0.3s;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-mobile.active {
  display: flex;
}

.nav-link-mobile {
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.nav-link-mobile:hover,
.nav-link-mobile.active {
  color: var(--accent);
  background-color: rgba(255, 255, 255, 0.1);
}

.register-mobile {
  background-color: var(--accent);
  color: var(--accent-foreground);
  margin-top: 0.5rem;
}

.register-mobile:hover {
  background-color: var(--accent);
  opacity: 0.9;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

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

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary);
  opacity: 0.9;
}

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-accent:hover:not(:disabled) {
  background-color: var(--accent);
  opacity: 0.9;
}

.btn-outline {
  border-color: var(--border);
  background-color: var(--background);
  color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--muted);
}

.btn-full {
  width: 100%;
}

.btn-icon,
.btn-icon-left,
.btn-icon-right {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary), hsl(221.2, 83.2%, 43.3%));
  color: var(--primary-foreground);
  padding: 4rem 0 6rem;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 6rem 0 8rem;
  }
}

.hero-content {
  text-align: center;
  max-width: 64rem;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.5rem;
  }
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.25rem;
  }
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

.hero-loading .skeleton,
.about-loading .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.2) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 4rem;
  width: 75%;
  margin: 0 auto 1.5rem;
}

.skeleton-subtitle {
  height: 2rem;
  width: 50%;
  margin: 0 auto 1rem;
}

.skeleton-description {
  height: 1.5rem;
  width: 100%;
  margin: 0 auto 2rem;
}

.skeleton-heading {
  height: 2.5rem;
  width: 66%;
  margin-bottom: 1.5rem;
}

.skeleton-text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 75%;
}

@keyframes loading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* About Section */
.about-section {
  padding: 4rem 0;
  background-color: var(--card);
}

.about-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.about-img {
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  width: 100%;
  height: auto;
}

.feature-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feature-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.feature-item span {
  font-weight: 500;
}

/* Event Info Section */
.event-info-section {
  padding: 4rem 0;
  background-color: var(--muted);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.features-grid {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background-color: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.feature-icon-circle {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.feature-icon-circle.primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.feature-icon-circle.accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-description {
  color: var(--muted-foreground);
}

/* Footer Styles */
.footer-main {
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 3rem 0;
}

.footer-content {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-description {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.footer-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-link {
  color: var(--primary-foreground);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.footer-link:hover {
  color: var(--accent);
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: var(--primary-foreground);
  transition: color 0.2s;
}

.social-link:hover {
  color: var(--accent);
}

.contact-info {
  opacity: 0.9;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.contact-icon {
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
}

.copyright {
  opacity: 0.8;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--muted-foreground);
}

.loading::after {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  border: 2px solid var(--muted-foreground);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Print Styles */
@media print {
  .header-main,
  .footer-main,
  .hero-buttons,
  .btn {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .hero-section {
    background: none;
    color: black;
    padding: 1rem 0;
  }
}