/* ===== Base Styles ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(to right, #eef2f3, #dbe9f4);
  padding: 0;
  min-height: 100vh;
  color: #1e293b;
  overflow-x: hidden;  
}

/* ====== CSS Variables ====== */
:root {
  --bg-light: #f8fafc;
  --border-color: #e2e8f0;
  --dropdown-border: #b3c1d1;
  --dropdown-hover: #f1f5f9;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text-color: #1e293b;
  --radius: 8px;
}

/* ====== Mobile Filter Toggle Button ====== */
.mobile-filter-btn {
  display: none;
  width: calc(100% - 30px);
  margin: 10px 15px;
  padding: 10px 20px;
  background: linear-gradient(to right, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.mobile-filter-btn:hover {
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ====== Filter Bar Base Styles ====== */
.filter-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 15px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin: 12px 15px;
}

.custom-dropdown-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.custom-dropdown {
  background-color: #ffffff;
  border: 1px solid var(--dropdown-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.custom-dropdown:hover {
  background-color: var(--dropdown-hover);
}

.custom-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--dropdown-border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.custom-dropdown-list li {
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 500;  
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.custom-dropdown-list li:hover {
  background-color: var(--dropdown-hover);
}

.filter-bar button {
  width: 100%;
  padding: 12px 15px;
  font-size: 15px;
  border-radius: var(--radius);
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.filter-bar button:hover {
  background-color: var(--primary-hover);
}

/* Apply Filters Mobile Button */
.apply-filters-mobile {
  display: none;
  background: linear-gradient(to right, #10b981, #047857);
  color: white;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Reset button */
.filter-bar button[onclick="resetFilters()"] {
  order: 11;
  background: linear-gradient(to right, #ef4444, #dc2626);
  color: white;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  margin-bottom: 0;
}

/* ====== Mobile Specific Styles ====== */
@media (max-width: 768px) {
  .mobile-filter-btn {
    display: block;
  }
  
  .filter-bar {
    display: none;
    margin: 0 15px 15px 15px;
    padding: 20px 15px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    gap: 15px;
  }
  
  .filter-bar.show {
    display: flex;
    animation: slideDown 0.3s ease-out;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .custom-dropdown {
    background-color: #f8fafc;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 400;
    color: #2d3748;
  }
  
  .custom-dropdown:focus,
  .custom-dropdown:active {
    border-color: #3b82f6;
    background-color: #ffffff;
    outline: none;
  }
  
  .custom-dropdown-list {
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    z-index: 1000;
  }
  
  .custom-dropdown-list li {
    padding: 12px 18px;
    font-size: 15px;
    border-bottom: 1px solid #f1f5f9;
  }
  
  .custom-dropdown-list li:last-child {
    border-bottom: none;
  }
  
  .custom-dropdown-list li:hover {
    background-color: #e2e8f0;
    color: #1a202c;
  }
  
  .apply-filters-mobile {
    display: block;    
    background: linear-gradient(to right, #10b981, #047857);
    color: white;
    font-weight: 350;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 1px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  }
  
  .apply-filters-mobile:hover {
    background: linear-gradient(to right, #047857, #065f46);
    transform: translateY(-1px);
  }
  
  /* Reset button styling */
  .filter-bar button[onclick="resetFilters()"] {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  }
  
  .filter-bar button[onclick="resetFilters()"]:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
    transform: translateY(-1px);
  }
  
  #filterBtn {
    display: none;
  }
}

/* ====== Desktop Styles ====== */
@media screen and (min-width: 769px) {
  .mobile-filter-btn,
  .apply-filters-mobile {
    display: none;
  }
  
  .filter-bar {
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    margin: 15px 200px;
    border-radius: 15px;
  }

  .custom-dropdown-wrapper {
    max-width: 200px;
  }

  .custom-dropdown {
    font-size: 13px;
    padding: 8px 10px;
  }

  .filter-bar button {
    width: auto;
    padding: 10px 25px;
    font-size: 14px;
  }
}

/* ====== Match Cards ====== */
.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: auto auto 60px auto;
}

.match-card {
  background: #b9c0c5;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-left: 15px;
  margin-right: 15px;
}

.match-type-line {
  font-size: 14px;
  color: #000;
  font-weight: bold;
  margin-bottom: 6px;
  text-align: center;
  font-weight: 400;
  font-style: italic;
}

.match-info {
  font-size: 14px;
  color: #444;
  margin-bottom: 12px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  padding: 4px 0;
}

.score {
  font-weight: bold;
  color: #111;
}

.overs {
  font-size: 12px;
  color: #777;
  margin-left: 4px;
}

.summary {
  font-size: 14px;
  color: #007b00;
  margin-top: 10px;
  font-style: italic;
  font-weight: 400;
}

.summary-btn {
  margin-top: 16px;
  padding: 10px 16px;
  font-size: 13px;
  background: linear-gradient(to right, #00aaff, #0077cc);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.summary-btn[disabled] {
  background-color: #ccc;
  cursor: not-allowed;
}

/* =================== RESPONSIVE FIX =================== */
/* Desktop: footer sticks to bottom */
@media (min-width: 768px) {
  #footer-container {
    margin-top: auto;
  }
}

/* Mobile: footer sits above bottom nav */
@media (max-width: 767px) {
  #footer-container {
    margin-bottom: 55px;
  }
}
