/* PLoW App - Standardized Styles */

/* ============================================
   BASE STYLES
   ============================================ */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #059669 0%, #047857 50%, #065f46 100%);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.5s ease;
}

/* ============================================
   NAVIGATION & SIDEBAR
   ============================================ */
.sidebar {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg, #1f2937 0%, #374151 100%);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-active {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.2) 0%, rgba(4, 120, 87, 0.2) 100%);
  border-right: 3px solid #059669;
  box-shadow: inset 0 0 10px rgba(5, 150, 105, 0.3);
}

.nav-link {
  color: #374151;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.nav-link:hover {
  background-color: #f3f4f6;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  margin: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Glassmorphism cards */
.card-glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-glass:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
  transition: all 0.3s ease;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #047857;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
  transform: translateY(-2px);
}

.btn-primary:focus {
  outline: 3px solid #059669;
  outline-offset: 2px;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-secondary:hover {
  background-color: #4b5563;
  box-shadow: 0 6px 20px rgba(75, 85, 99, 0.5);
  transform: translateY(-2px);
}

.btn-secondary:focus {
  outline: 3px solid #059669;
  outline-offset: 2px;
}

.btn-success {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-success:hover {
  background-color: #059669;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
  transform: translateY(-2px);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #059669;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  font-weight: 500;
}

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

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ============================================
   VIEW TRANSITIONS
   ============================================ */
.view {
  display: none;
}

.view:not(.hidden) {
  display: block;
}

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

.view {
  animation: fadeInUp 0.5s ease-out;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem;
}

.empty-state i {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.empty-state p {
  color: #6b7280;
  margin-bottom: 1rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-container {
  width: 300px;
  margin: 100px auto;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

input, button, select {
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

/* ============================================
   TABLE STYLES
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px;
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

tr:hover {
  background-color: #f9fafb;
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ============================================
   CAROUSEL
   ============================================ */
.carousel-container {
  width: 400%;
}

.carousel-slide {
  width: 25%;
}

.carousel-indicator.active {
  background-color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  animation: spin 1s linear infinite;
}

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

/* Pulse animation for buttons */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  }
  50% {
    box-shadow: 0 0 10px 10px rgba(5, 150, 105, 0);
  }
}

.btn-pulse {
  animation: pulse 3s infinite;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 30;
    height: 100vh;
    top: 0;
    left: 0;
    width: 15rem;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    margin: 10px;
    overflow-x: hidden;
  }

  .carousel-slide img {
    height: 200px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.75rem;
  }

  th, td {
    padding: 0.25rem 0.5rem;
  }

  /* Bottom navigation for mobile */
  #nav-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 56px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1) !important;
    z-index: 20 !important;
    transform: none !important;
  }

  #nav-menu nav {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-around !important;
    padding: 0 !important;
  }

  #nav-menu nav a {
    flex: 1 !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #nav-menu nav a span {
    display: none !important;
  }

  #nav-menu nav a i {
    font-size: 1.5rem !important;
  }

  #nav-menu > div:first-child,
  #nav-menu > div.p-4.border-t {
    display: none !important;
  }

  .main-content {
    margin-bottom: 56px !important;
  }
}

/* ============================================
   LEADERBOARD CATEGORY BUTTONS
   ============================================ */
#leaderboard-category-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  overflow: hidden;
}

#leaderboard-category-buttons .btn-category {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  #leaderboard-category-buttons .btn-category {
    font-size: 0.75rem;
    padding: 5px 6px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-pattern {
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 1%, transparent 1%),
    radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1%, transparent 1%);
  background-size: 50px 50px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #059669;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #047857;
}
