/**
 * Football Engine - Custom CSS
 * 
 * This file contains custom styles that extend Tailwind CSS
 */

/* Primary Colors */
.text-primary-500 {
  color: #0ea5e9;
}

.text-primary-600 {
  color: #0284c7;
}

.bg-primary-500 {
  background-color: #0ea5e9;
}

.bg-primary-600 {
  background-color: #0284c7;
}

.bg-primary-700 {
  background-color: #0369a1;
}

.border-primary-500 {
  border-color: #0ea5e9;
}

.border-primary-600 {
  border-color: #0284c7;
}

.ring-primary-500 {
  --tw-ring-color: #0ea5e9;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  position: relative;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

/* Custom shadow on right edge to indicate scrollable content */
.scrollbar-hide::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
  pointer-events: none;
  z-index: 1;
}

/* Custom styling for the tab container */
.relative.flex.items-center {
  position: relative;
  padding: 0;
}

/* Button positioning for fixed refresh button */
.absolute.right-0.flex.items-center.pl-2.bg-white {
  background: linear-gradient(to right, rgba(243,244,246,0), rgba(243,244,246,1) 20%);
  padding-left: 20px;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 5;
}

/* Header layout */
header .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Middle row filter buttons */
.filter-dropdown-button,
.date-dropdown-button,
.more-filters-button,
.most-recent-button {
  height: 36px;
  font-size: 0.875rem;
  background-color: white;
  border-color: #e5e7eb;
  transition: background-color 0.2s, border-color 0.2s;
}

.filter-dropdown-button:hover,
.date-dropdown-button:hover,
.more-filters-button:hover,
.most-recent-button:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

/* Search bar styling */
.relative input[placeholder*="Search events"] {
  height: 36px;
  border-color: #e5e7eb;
}

/* Tab Navigation - Final Layout Adjustments */
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  height: 40px;
  min-width: fit-content;
  border: none;
  border-radius: 0;
  background-color: transparent;
  color: #6b7280; /* gray-500 */
}

.tab-button.active {
  color: #000000; /* Black text for active */
  font-weight: 600;
  background-color: transparent;
  position: relative;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #000000;
}

.tab-button:not(.active) {
  background-color: transparent;
  color: #6b7280; /* gray-500 */
}

.tab-button:hover:not(.active) {
  color: #1f2937; /* gray-800 */
  background-color: transparent;
}

/* Tab container background */
.border-t.border-gray-200.bg-gray-100 {
  background-color: #f9fafb; /* Extra light gray background */
}

/* Ensure proper spacing and layout for tab container */
.flex.overflow-x-auto.space-x-2.py-2 {
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
}

.flex.overflow-x-auto.space-x-2.py-2::-webkit-scrollbar {
  display: none;
}

/* Dropdown styling */
.filter-dropdown-menu,
.date-dropdown-menu,
.more-filters-menu,
.most-recent-menu,
.user-dropdown-menu {
  transform-origin: top right;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Main menu dropdown styling */
.main-menu .submenu {
  transform-origin: top left;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

/* Main menu hover effects */
.main-menu a:hover {
  color: #0ea5e9;
}

/* Main navigation dropdown behavior */
.main-nav .group .absolute {
  transform-origin: top left;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

/* Main navigation dropdown display on hover and when triggered by JavaScript */
.main-nav .group:hover .absolute,
.main-nav .group .absolute.show {
  display: block !important;
}

/* Mobile menu styling */
@media (max-width: 768px) {
  .main-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: none;
  }
  
  .main-menu:not(.hidden) {
    display: block;
  }
  
  .main-menu ul {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: #1f2937;
    padding: 1rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .main-menu:not(.hidden) ul {
    transform: translateX(0);
  }
  
  .main-menu li {
    margin-bottom: 0.5rem;
  }
  
  .main-menu .submenu {
    position: static;
    box-shadow: none;
    width: 100%;
    margin-top: 0.25rem;
    margin-left: 1rem;
    padding: 0;
    display: none;
  }
  
  .main-menu .submenu:not(.hidden) {
    display: block;
  }
  
  .main-menu .fa-chevron-down,
  .main-menu .fa-chevron-up {
    transition: transform 0.3s ease-in-out;
  }
  
  .main-menu .fa-chevron-up {
    transform: rotate(180deg);
  }
}

/* Custom animations */
.slide-in-bottom {
  animation: slide-in-bottom 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slide-in-bottom {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Football-specific styling */
.fa-trophy, .fa-whistle, .fa-home, .fa-shield-alt, .fa-running, .fa-newspaper, .fa-chart-bar, .fa-info-circle {
  font-size: 1rem;
}

/* Search bar focus styling */
input[placeholder*="Search events"]:focus {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
  border-color: #0ea5e9;
}

/* Dropdown buttons styling */
.filter-dropdown-button,
.date-dropdown-button,
.more-filters-button,
.most-recent-button,
.user-dropdown-button {
  white-space: nowrap;
}

/* Button styles */
.bg-primary-600 {
  background-color: #0284c7;
}

.bg-primary-700 {
  background-color: #0369a1;
}

.text-primary-600 {
  color: #0284c7;
}

.border-primary-600 {
  border-color: #0284c7;
}

/* Tab Navigation */
.flex.overflow-x-auto button {
  transition: color 0.2s ease, border-color 0.2s ease;
}

/* Refresh button animation */
.fa-spin {
  animation: fa-spin 2s linear infinite;
}

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

/* Filter button hover states */
#filter-menu-button:hover,
#date-menu-button:hover,
#more-filters-button:hover,
#most-recent-button:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
}

/* Dropdown menu items */
.filter-dropdown-menu a,
.date-dropdown-menu a,
.more-filters-menu a,
.most-recent-menu a {
  transition: background-color 0.2s ease;
}

.filter-dropdown-menu a:hover,
.date-dropdown-menu a:hover,
.more-filters-menu a:hover,
.most-recent-menu a:hover {
  background-color: #f3f4f6;
}

/* Checkbox styling for More Filters */
.form-checkbox {
  border-radius: 0.25rem;
  border-color: #d1d5db;
  color: #0ea5e9;
}

.form-checkbox:checked {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
}

.more-filters-menu h3 {
  font-weight: 600;
}

.more-filters-menu label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.more-filters-menu .apply-filters-button {
  transition: background-color 0.2s ease;
}

/* Most Recent dropdown checkmarks */
.sort-option .fa-check {
  width: 16px;
}

/* Middle row design */
.middle-row {
  background-color: white;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

/* Preloader animation */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

#preloader::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.fade-out {
  opacity: 0 !important;
}

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

/* Custom focus styles */
.focus-visible:focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* Card hover effects */
.bg-white.rounded-lg {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-white.rounded-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom avatar styles */
img.rounded-full {
  object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .space-y-6 {
    --tw-space-y-reverse: 0;
    margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(1rem * var(--tw-space-y-reverse));
  }
}

/* Custom badge styles */
.bg-blue-100.text-blue-800 {
  background-color: rgba(191, 219, 254, 0.6);
  color: #1e40af;
}

.bg-red-100.text-red-800 {
  background-color: rgba(254, 202, 202, 0.6);
  color: #991b1b;
}

/* Comment section styling */
.bg-gray-50.p-3.rounded-lg {
  transition: background-color 0.2s ease;
}

.bg-gray-50.p-3.rounded-lg:hover {
  background-color: #f3f4f6;
}

/* Refresh button final styling */
#refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #6b7280;
  width: 40px;
  height: 40px;
  border-radius: 0;
  font-size: 1rem;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
  padding: 0;
}

#refresh-button span {
  display: none; /* Hide the text */
}

#refresh-button:hover {
  color: #000000;
}

#refresh-button i {
  margin-right: 0;
}

/* Tab navigation container */
.relative.flex.items-center {
  position: relative;
  padding: 0;
}

/* Tabs scrollable container */
.flex-grow.overflow-x-auto.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
  margin-right: 40px; /* Space for refresh button only */
  position: relative;
}

.flex-grow.overflow-x-auto.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Space between tab buttons */
.flex.min-w-max {
  gap: 0; /* No gap as per reference design */
}

/* Right-fixed refresh button container */
.absolute.right-0.flex.items-center.pl-2.bg-transparent {
  background: linear-gradient(to right, rgba(249,250,251,0), rgba(249,250,251,1) 40%);
  padding-left: 25px;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 5;
}

/* Content width matching container */
main.container, 
header .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Main content event cards */
.space-y-6 {
  max-width: 1200px;
  margin: 0 auto;
}

/* Container width consistency */
.container {
  max-width: 1200px !important;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Ensure consistent width for all major sections */
header .container,
main .container,
footer .container,
.container {
  max-width: 1200px !important;
}

/* Remove any conflicting max-width settings */
.space-y-6 {
  max-width: none;
} 