/* Global Styles */
:root {
  --primary: #d31027;
  --primary-light: #ea384d;
  --primary-dark: #a50d1f;
  --primary-gradient-start: #d31027;
  --primary-gradient-end: #ea384d;
  --secondary: #6c757d;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #343a40;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 70px;
  --topbar-height: 60px;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, var(--primary-gradient-start), var(--primary-gradient-end));
  color: var(--white);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar.active {
  width: var(--sidebar-width-collapsed);
  padding: 1rem 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  filter: brightness(0.3) contrast(1.2);
  mix-blend-mode: normal;
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  margin-left: 0.75rem;
  margin-bottom: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.active .brand {
  justify-content: center;
  padding: 0.5rem 0;
}

.sidebar.active .brand-text {
  opacity: 0;
  width: 0;
  margin-left: 0;
}

.sidebar .nav-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.active .nav-heading {
  opacity: 0;
}

.sidebar .nav-link {
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  margin-right: 0.75rem;
  transition: all 0.3s ease;
}

.sidebar.active .nav-link i {
  margin-right: 0;
  font-size: 1.3rem;
}

.sidebar .nav-link span {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.active .nav-link span {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar-footer {
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  transition: opacity 0.3s ease;
}

.sidebar.active .sidebar-footer {
  opacity: 0;
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 20px) 20px 20px;
  min-height: 100vh;
  transition: all 0.3s ease;
}

.completed-matches-table {
  min-width: 350px;
  max-width: 500px;
}

.completed-matches-table tbody tr {
  height: 28px  !important; 
}

.completed-matches-table td,
.completed-matches-table th {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

.main-content.active {
  margin-left: var(--sidebar-width-collapsed);
}

/* Top Navigation */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  background-color: var(--white);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  z-index: 999;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.navbar.active {
  padding-left: 1rem;
}

#sidebarToggle {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

#sidebarToggle:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.navbar .dropdown-toggle::after {
  display: none;
}

.navbar .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
  padding: 0.5rem 0;
}

.navbar .dropdown-item {
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
  background-color: var(--gray-100);
  color: var(--primary);
}

/* Favorite Bar */
.favorite-bar {
  background-color: var(--white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.favorite-bar .title {
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.favorite-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.favorite-tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background-color: var(--gray-100);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.favorite-tab:hover {
  background-color: var(--gray-200);
  color: var(--gray-900);
}

.favorite-tab.active {
  background-color: var(--primary-light);
  color: var(--white);
}

/* Card Styles */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
}

.card-title {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--gray-900);
}

/* Dashboard Cards */
.dashboard-card {
  transition: all 0.3s;
  border-radius: 0.5rem;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.dashboard-card .icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.dashboard-card .card-title {
  font-size: 1rem;
  font-weight: 500;
}

.dashboard-card .card-text {
  font-size: 2rem;
  font-weight: 700;
}

/* Metric Cards */
.metric-card {
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
  opacity: 0.9;
  z-index: -1;
  border-radius: 12px;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.metric-card .metric-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  color: rgba(255, 255, 255, 0.85);
}

.metric-card .metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--white);
}

.metric-card .metric-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 500;
}

/* Gradient Backgrounds */
.primary-gradient {
  background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
  color: white;
}

.success-gradient {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
}

.warning-gradient {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: white;
}

.info-gradient {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
}

/* Button Styles */
.btn-primary {
  background: linear-gradient(to right, var(--primary-gradient-start), var(--primary-gradient-end));
  border: none;
  box-shadow: 0 4px 8px rgba(211, 16, 39, 0.2);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(211, 16, 39, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(211, 16, 39, 0.2);
}

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

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

/* Form Styles */
.form-control, .form-select {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(211, 16, 39, 0.25);
}

.form-floating > .form-control, 
.form-floating > .form-select {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.75rem;
}

.form-floating > label {
  padding: 1rem 0.75rem;
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

/* Table Styles */
.table {
  color: var(--gray-700);
  margin-bottom: 0;
}

.table th {
  font-weight: 600;
  border-top: none;
  padding: 1rem;
  background-color: var(--gray-100);
  color: var(--gray-800);
}

.table td {
  vertical-align: middle;
  padding: 1rem;
  border-color: var(--gray-200);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

/* Alert Styles */
.alert {
  border-radius: 8px;
  border: none;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.15);
  color: var(--success);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.15);
  color: var(--danger);
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.15);
  color: var(--warning);
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.15);
  color: var(--info);
}

/* User Profile in Navbar */
.user-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

/* Breadcrumbs */
.breadcrumb {
  margin-bottom: 1.5rem;
  background-color: transparent;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--gray-600);
}

/* Extra styles for team pages */
.team-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.logo-preview {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  margin-bottom: 0.5rem;
}

/* Status Badges */
.badge.bg-success {
  background-color: var(--success) !important;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.badge.bg-warning {
  background-color: var(--warning) !important;
  color: #212529;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.badge.bg-danger {
  background-color: var(--danger) !important;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Recent Activity */
.list-group-item {
  transition: all 0.2s;
  border-left: none;
  border-right: none;
  padding: 1rem 1.25rem;
}

.list-group-item:hover {
  background-color: rgba(248, 249, 250, 0.7);
}

/* Pagination */
.pagination .page-link {
  border-radius: 0.25rem;
  margin: 0 2px;
  color: var(--primary);
  border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.pagination .page-link:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--primary-dark);
  border-color: rgba(220, 53, 69, 0.2);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1); 
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2); 
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3); 
}

/* Dropdown z-index fixes */
.dropdown-menu {
  z-index: 1055 !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.dropdown {
  z-index: 1054 !important;
}

.dropdown-menu.show {
  z-index: 1056 !important;
}

/* Responsive Adjustments */
/* Custom Radio Button Styles */
.custom-radio-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.custom-radio-wrapper {
  position: relative;
  display: inline-block;
}

.custom-radio-wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.custom-radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: var(--gray-700);
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background-color: transparent;
}

.custom-radio-label:hover {
  background-color: rgba(211, 16, 39, 0.05);
  color: var(--primary);
}

.custom-radio-indicator {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  transition: all 0.3s ease;
  background-color: var(--white);
}

.custom-radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
  transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-radio-wrapper input[type="radio"]:checked + .custom-radio-label .custom-radio-indicator {
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(211, 16, 39, 0.1);
}

.custom-radio-wrapper input[type="radio"]:checked + .custom-radio-label .custom-radio-indicator::after {
  transform: translate(-50%, -50%) scale(1);
}

.custom-radio-wrapper input[type="radio"]:checked + .custom-radio-label {
  color: var(--primary);
  font-weight: 600;
}

.custom-radio-wrapper input[type="radio"]:focus + .custom-radio-label .custom-radio-indicator {
  box-shadow: 0 0 0 4px rgba(211, 16, 39, 0.15);
}

.custom-radio-wrapper input[type="radio"]:disabled + .custom-radio-label {
  opacity: 0.5;
  cursor: not-allowed;
}

.custom-radio-wrapper input[type="radio"]:disabled + .custom-radio-label .custom-radio-indicator {
  border-color: var(--gray-300);
  background-color: var(--gray-100);
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.active {
    transform: translateX(0);
    width: var(--sidebar-width);
  }

  .sidebar.active .brand-text,
  .sidebar.active .nav-heading,
  .sidebar.active .nav-link span,
  .sidebar.active .sidebar-footer {
    opacity: 1;
    width: auto;
    margin-left: 0.75rem;
  }

  .sidebar.active .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
  }

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

  .main-content.active {
    margin-left: 0;
    filter: brightness(0.8);
    overflow: hidden;
  }
}