/* Golf Manager Pro Styles */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1587174486073-ae3f4e38f23c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: -1;
}

.sidebar {
  transition: transform 0.3s ease;
}

.main-content {
  transition: margin-left 0.3s ease;
  min-height: 100vh;
}

.view {
  display: none;
}

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

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: #059669;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #047857;
}

.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.2s;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.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.2s;
}

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

.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.2s;
}

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

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #059669;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.3s ease;
  z-index: 1000;
}

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

.toast.error {
  background-color: #ef4444;
}

.sidebar-active {
  background-color: #ecfdf5;
  color: #059669;
  border-right: 3px solid #059669;
}

.nav-link {
  color: #374151;
  text-decoration: none;
}

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

.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;
}

/* Responsive Design */
@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 30;
    height: 100vh;
    top: 0;
    left: 0;
    width: 15rem; /* 60 */
    background: linear-gradient(180deg, #1f2937 0%, #374151 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .main-content {
    margin-left: 0;
  }
}

/* Chart containers */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Carousel Styles */
.carousel-container {
  width: 400%; /* 4 slides */
}

.carousel-slide {
  width: 25%; /* 1/4 of container */
}

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

/* Enhanced Professional Styles */
.sidebar {
  background: linear-gradient(180deg, #1f2937 0%, #374151 100%);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
  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);
}

.card {
  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:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.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;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.nav-link {
  transition: all 0.3s ease;
}

.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);
}

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

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

/* Responsive improvements */
@media (max-width: 640px) {
  .main-content {
    margin: 10px;
    overflow-x: hidden;
  }

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

  /* Make leaderboard table horizontally scrollable */
  #leaderboard-view table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.75rem; /* smaller font size */
  }

  #leaderboard-view th,
  #leaderboard-view td {
    padding: 0.25rem 0.5rem; /* reduce padding */
  }
}

/* Professional animations and enhancements */
body {
  transition: background-color 0.5s ease;
}

.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);
}

.sidebar-active {
  box-shadow: inset 0 0 15px rgba(5, 150, 105, 0.5);
  transition: box-shadow 0.4s ease;
}

.nav-link {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
  background-color: transparent !important;
  color: inherit !important;
  transform: none !important;
  transition: none !important;
}

.btn-primary {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

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

.btn-secondary {
  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-success {
  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 {
  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);
}

.card {
  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);
}

.toast {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.toast.error {
  background-color: #ef4444;
}

/* Smooth fade-in for views */
.view {
  animation: fadeInUp 0.6s ease-out;
}

/* Button focus outlines */
.btn-primary:focus,
.btn-secondary:focus,
.btn-success:focus,
.btn-danger:focus {
  outline: 3px solid #059669;
  outline-offset: 2px;
}

/* Chat icon animation */
#chat-icon {
  transition: background-color 0.3s ease, transform 0.3s ease;
}

#chat-icon:hover {
  background-color: #047857;
  transform: scale(1.1);
}

/* Add subtle pulse animation to login button */
#login-logout-btn {
  animation: pulse 3s infinite;
}

@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);
  }
}

  /* Mobile bottom navigation */
  @media (max-width: 640px) {
    /* Hide the sidebar toggle button */
    #sidebar-open-btn {
      display: none !important;
    }

    /* Transform sidebar into bottom navigation */
    #sidebar {
      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; /* Override the translateX */
    }

    /* Sidebar nav as horizontal */
    #sidebar nav {
      display: flex !important;
      flex-direction: row !important;
      width: 100% !important;
      justify-content: space-around !important;
      padding: 0 !important;
    }

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

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

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

    /* Hide the sidebar header */
    #sidebar > div:first-child {
      display: none !important;
    }

    /* Hide the login button in bottom nav */
    #sidebar > div.p-4.border-t {
      display: none !important;
    }

    /* Adjust main content for bottom nav */
    .main-content {
      margin-bottom: 56px !important;
    }
  }
