/* Google Fonts - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
   display: flex;
  flex-direction: column;
  margin: 0;
  background: #ffffff;
  color: #333;
  min-height: 100vh;
}

/* Header */
nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 70px;
  width: 100%;
  display: flex;
  align-items: center;
  background: #ffffff;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12); /* More pronounced shadow */
  z-index: 100;
}

nav .logo {
  display: flex;
  align-items: center;
  margin: 0 24px;
}

.logo .menu-icon {
  color: #333;
  font-size: 24px;
  margin-right: 14px;
  cursor: pointer;
}

.logo .logo-name {
  color: #333;
  font-size: 22px;
  font-weight: 600;
}

/* Sidebar */
nav .sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  height: 100%;
  width: 260px;
  padding: 20px 0;
  background-color: #f0f5ff; /* Slight blue tint */
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  transition: all 0.4s ease;
  z-index: 99;
}

nav.open .sidebar {
  left: 0;
}

.sidebar .sidebar-content {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 16px;
}

.sidebar-content .list {
  list-style: none;
}

.list .nav-link {
  display: flex;
  align-items: center;
  margin: 8px 0;
  padding: 14px 12px;
  text-decoration: none;
  transition: background 0.3s;
}

.lists .nav-link:hover {
  background-color: #4070f4;
}

.nav-link .icon {
  margin-right: 14px;
  font-size: 20px;
  color: #707070;
}

.nav-link .link {
  font-size: 16px;
  color: #707070;
  font-weight: 400;
}

.lists .nav-link:hover .icon,
.lists .nav-link:hover .link {
  color: #fff;
}

.bottom-content .nav-link {
  color: #555;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: -100%;
  height: 1000vh;
  width: 200%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  background: rgba(0, 0, 0, 0.3);
}
nav.open ~ .overlay {
  opacity: 1;
  left: 260px;
  pointer-events: auto;
}

/* Make main content take all remaining space */
main.content {
  flex: 1; /* expands to fill space above footer */
  padding: 100px 40px;
  width: 85%;
  margin: auto;
}

.content h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.content p {
  color: #555;
  margin-bottom: 40px;
}

/* Active navigation link */
.nav-link.active {
  background-color: #4070f4;
}

.nav-link.active .icon,
.nav-link.active .link {
  color: #fff;
}

/* === Year Selector (Floating Material Style) === */
.year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 25px 0 35px 0;
}

/* Floating circular buttons */
.year-btn {
  background: #ffffff;
  color: #1a73e8; /* Google blue tone */
  border: none;
  width: 50px;
  height: 50px;
  font-size: 1.6rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  background: #f8f9fa;
}

.year-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Year dropdown matches the clean look */
.year-dropdown {
  appearance: none;
  background: #ffffff;
  color: #1a73e8;
  border: 2px solid #1a73e8;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  outline: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.year-dropdown:hover,
.year-dropdown:focus {
  background: #f0f6ff;
  box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
  .year-selector {
    flex-direction: column;
    gap: 12px;
  }

  .year-btn {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .year-dropdown {
    width: 100%;
    max-width: 220px;
  }
}

/* Table Styling - Full Width */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 60px;
}

.first-place {
  background-color: #FFFFBF;
  font-weight: bold;
}

.second-place {
  background-color: #DFDFDF;
  font-weight: bold;
}

.third-place {
  background-color: #FFDF9F;
  font-weight: bold;
}

.points-finisher {
  background-color: #DFFFDF;
}

.no-classification {
  background-color: #EFCFFF;
  font-style: italic;
}

.no-points {
  background-color: #CFCFFF;
}

.points-table {
  font-size: 12px;
  width: 100%;
  border: 1px solid #575757;
  border-collapse: collapse;
  background-color: #f5f5f5;
  color: #1e1e2f;
  font-family: Arial, sans-serif;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: max-content; /* Allow horizontal scrolling if needed */
}

.points-table th,
.points-table td {
  border: 1px solid #575757;
  padding: 6px 10px;
  text-align: left;
}

.points-table td:nth-child(1) { 
  background-color: #ababab;
  font-weight: bold;
}

.points-table th {
  background-color: #ababab;
}

/* Scrollbar styling (optional) */
.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
}

 /* === Calendar Table (Styled to Match Points Table) === */
.calendar-table {
  font-size: 12px;
  width: 100%;
  border: 1px solid #575757;
  border-collapse: collapse;
  background-color: #f5f5f5;
  color: #1e1e2f;
  font-family: Arial, sans-serif;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: max-content; /* Enable horizontal scrolling if needed */
}

.calendar-table th,
.calendar-table td {
  border: 1px solid #575757;
  padding: 6px 10px;
  text-align: left;
}

.calendar-table th {
  background-color: #ababab;
  font-weight: bold;
}

.calendar-table td:nth-child(1) {
  background-color: #ababab;
  font-weight: bold;
}

.calendar-table tbody tr:nth-child(even) {
  background-color: #eaeaea;
}

.calendar-table tbody tr:hover {
  background-color: #ababab;
  transition: background-color 0.3s ease;
}

/* Scrollbar styling (same as points table) */
.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
}

/* Footer Styling */
footer {
  background-color: #333;
  color: #fff;
  padding: 20px;
  text-align: center;
  position: relative;
  width: 100%;
  margin-top: auto; /* This ensures footer sticks to the bottom */
}

/* Subheader styling */
.subheader {
  position: sticky;       /* stays below nav when scrolling */
  top: 70px;              /* same as nav height */
  display: flex;
  justify-content: flex-start; /* align left */
  align-items: center;
  gap: 32px;
  padding: 12px 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 99;
}

/* Each item in subheader */
.subheader-item {
  flex-direction: row;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* Labels */
.subheader-item label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
  white-space: nowrap; /* prevent label from wrapping */
}

/* White dropdowns with black text */
.subheader-item select {
  appearance: none;
  background: #ffffff;    /* white background */
  color: #333;         /* black text */
  border: 2px solid #333; /* subtle dark border */
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease-in-out;
}

.subheader-item select:hover,
.subheader-item select:focus {
  background: #f0f0f0;    /* light gray on hover/focus */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.year-dropdown-grid-wrapper {
  position: relative;
  display: inline-block;
}

.year-dropdown-btn {
  background: white;
  color: #333;
  border: 2px solid #333;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  min-width: 100px;
}

.year-grid {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #333;
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* number of columns */
  gap: 4px;
  overflow-y: auto;
  margin-top: 4px;
  z-index: 100;
}

.year-grid > button {
  border: none !important;
  box-shadow: none !important;
}

.year-grid button {
  background: white;
  border: none;       /* remove any border */
  border-radius: 0;   /* optional: remove any rounding if you want */
  padding: 6px 4px;   /* keep or adjust padding */
  cursor: pointer;
  font-weight: 500;
}

.year-grid button:hover {
  background: #1a73e8;
  color: white;
}

.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 600px) {
  .subheader {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .subheader-item select {
    width: 140px;
  }
}

/* Dark Mode Toggle Button in Subheader */
.subheader-item .dark-toggle {
  background: white;            /* same as dropdown */
  color: black;                 /* same text color */
  border: 2px solid #1a73e8;   /* same accent border */
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
  min-width: 50px;
}

/* Hover and focus effect */
.subheader-item .dark-toggle:hover,
.subheader-item .dark-toggle:focus {
  background: #f0f6ff; /* light hover effect same as other buttons */
  box-shadow: 0 4px 10px rgba(26, 115, 232, 0.3);
}

/* Icon inside toggle button */
.subheader-item .dark-toggle i {
  font-size: 1.2rem; /* slightly smaller to fit neatly */
}

/* === Dark Mode === */
body.dark-mode {
  background-color: #000000; /* page background black */
  color: #ffffff;           /* default text white */
}

body.dark-mode nav {
  background-color: #111;   /* darker nav */
  box-shadow: 0 6px 15px rgba(255, 165, 0, 0.2); /* subtle orange shadow */
}

body.dark-mode nav .logo .logo-name,
body.dark-mode nav .menu-icon {
  color: #FFA500; /* orange accent */
}

body.dark-mode .sidebar {
  background-color: #111; /* dark sidebar */
  box-shadow: 2px 0 8px rgba(255, 165, 0, 0.3);
}

body.dark-mode .sidebar .nav-link,
body.dark-mode .sidebar .nav-link .link,
body.dark-mode .sidebar .nav-link .icon {
  color: #FFA500; /* orange links */
}

body.dark-mode .sidebar .nav-link.active,
body.dark-mode .sidebar .nav-link:hover {
  background-color: #FFA500;
}

body.dark-mode .sidebar .nav-link.active .link,
body.dark-mode .sidebar .nav-link.active .icon,
body.dark-mode .sidebar .nav-link:hover .link,
body.dark-mode .sidebar .nav-link:hover .icon {
  color: #000; /* black text on orange background */
}

/* Content areas */
body.dark-mode main.content,
body.dark-mode .landing-container,
body.dark-mode .landing-left,
body.dark-mode .landing-right {
  background-color: #000; /* black background */
  color: #fff;           /* white text */
}

/* Buttons */
body.dark-mode .btn-primary,
body.dark-mode .landing-options a {
  background-color: #FFA500; /* orange buttons */
  color: #000;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .landing-options a:hover {
  background-color: #e69500; /* darker orange on hover */
  color: #000;
}

/* Tables (if any) */
body.dark-mode .points-table,
body.dark-mode .calendar-table {
  background-color: #111;
  color: #FFA500;
  border-color: #FFA500;
}

body.dark-mode .points-table th,
body.dark-mode .calendar-table th {
  background-color: #222;
}

/* Footer */
body.dark-mode footer {
  background-color: #111;
  color: #FFA500;
}

/* Inputs / dropdowns */
body.dark-mode select,
body.dark-mode .year-dropdown-btn {
  background-color: #000;
  color: #FFA500;
  border: 2px solid #FFA500;
}

body.dark-mode select:hover,
body.dark-mode select:focus,
body.dark-mode .year-dropdown-btn:hover {
  background-color: #111;
  box-shadow: 0 4px 10px rgba(255, 165, 0, 0.3);
}

/* Sidebar Dropdown */
.sidebar-dropdown .dropdown-menu {
  display: none;       /* hidden by default */
  list-style: none;
  padding-left: 20px;  /* indent submenu */
  margin: 5px 0 0 0;
}

.sidebar-dropdown .dropdown-menu li a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: #707070;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-dropdown .dropdown-menu li a:hover {
  background-color: #4070f4; /* same hover as sidebar links */
  color: #fff;
}

.sidebar-dropdown.open .dropdown-menu {
  display: block;
}

/* Rotate arrow when open */
.sidebar-dropdown.open .dropdown-icon {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.sidebar-dropdown .dropdown-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

/* Match Add/Delete buttons to the profile <select> size */
.subheader-item button {
  background: #ffffff;
  color: #333;
  border: 2px solid #333;

  /* Match select field */
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  height: 38px;            /* EXACT height of your <select> */
  display: flex;
  align-items: center;
}

/* Hover / active */
.subheader-item button:hover {
  background: #f0f0f0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.subheader-item button:active {
  transform: scale(0.97);
}

/* --- Dark Mode --- */
body.dark-mode .subheader-item button {
  background: #000;
  color: #FFA500;
  border: 2px solid #FFA500;
}

body.dark-mode .subheader-item button:hover {
  background: #111;
  box-shadow: 0 4px 10px rgba(255,165,0,0.3);
}


.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px;
   margin-left: auto; /* pushes the div to the right */
}

/* Hide checkbox */
#darkModeToggle {
  display: none;
}

/* Toggle label */
.toggle-label {
  position: relative;
  width: 80px;
  height: 36px;
  background-color: #eee;
  border-radius: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 5px;
  transition: background-color 0.3s;
  box-sizing: border-box;
}

/* Slider (circle) */
.toggle-label .slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #333;
}

/* Text inside the toggle */
.slider-text {
  position: absolute;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  color: #555;
}

/* Checked state */
#darkModeToggle:checked + .toggle-label {
  background-color: #333;
}

#darkModeToggle:checked + .toggle-label .slider {
  transform: translateX(44px);
  color: #fff;
}