@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap");

/* General Styles */
body {
  font-family: "Montserrat", sans-serif;
  background-color: #f4f4f9;
  margin: 0;
  padding: 20px;
  padding-bottom: 100px; /* Add bottom padding to prevent overlap with reset button */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100vh;
}

/* Rotated Gym Title */
#tit {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left top;
  font-weight: bold;
  font-size: 6vh;
  color: darkblue;
  white-space: nowrap;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-align: center;
  margin-top: 50px;
  z-index: 1;
  max-width: 100vh;
  line-height: 1.2;
}

/* Main Heading */
h1 {
  color: hotpink;
  margin-top: 20px;
  text-transform: uppercase;
  font-size: 2.5rem;
}

/* ✅ Responsive Grid for Sections (Always 2 per Row) */
.section-container {
  display: flex; /* Use flex instead of grid */
  flex-wrap: wrap; /* Allow wrapping if needed */
  gap: 20px;
  justify-content: center;
  width: 90%;
  max-width: 1200px;
}

/* ✅ Workout Container - Ensure proper spacing */
#workout-container {
  padding-bottom: 80px; /* Extra padding to prevent overlap with reset button */
  width: 100%;
}

/* Section Box */
.section {
  min-height: 400px;
  padding: 20px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid transparent;
}

/* Section Backgrounds */
.section#KK {
  background-color: lightblue;
}

.section#VV {
  background-color: lightpink;
}

/* Section Headings */
.section h2 {
  text-align: center;
  color: darkblue;
  margin-bottom: 15px;
  font-size: 1.6rem;
}

/* Exercise List */
.exercise-list {
  list-style-type: none;
  padding: 0;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Exercise Items */
.exercise-item {
  background-color: #fff;
  width: 100%;
  margin: 8px 0;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover Effect */
.exercise-item:hover {
  background-color: #f1f1f1;
  transform: scale(1.02);
}

/* Checkbox Styling */
.exercise-item input[type="checkbox"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Sub Exercise List */
.sub-exercise-list {
  margin-top: 8px;
  padding: 0;
  width: 100%;
  list-style-type: none;
}

/* Sub Exercise Item */
.sub-exercise-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
}

/* Strike-through for Completed Sections */
.strike-through {
  text-decoration: line-through;
  color: gray;
  font-weight: normal;
  opacity: 0.7;
}

/* ✅ Mobile Optimizations - Make everything smaller to fit both columns */
@media (max-width: 600px) {
  /* Reduce body padding */
  body {
    padding: 4px;
  }

  /* Make gym title smaller */
  #tit {
    font-size: 1.5vh;
    left: 5px;
    letter-spacing: 2px;
  }

  /* Make day title much smaller to fit everything */
  .day-title {
    width: 95%;
    padding: 6px 8px;
    font-size: 0.7rem;
    margin: 4px auto;
    border-radius: 8px;
    line-height: 1.2;
  }

  /* Optimize day content for mobile */
  .day-content {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0 2px;
    padding-top: 4px;
    width: 99%;
  }

  /* Reduce spacing between workout containers and add top margin */
  #workout-container {
    gap: 8px;
    margin-top: 50px; /* Push below dark mode toggle */
    padding-bottom: 60px; /* Reduced padding for mobile */
  }

  /* Make sections much smaller */
  .section {
    min-width: 48%; /* Almost half width */
    max-width: 48%;
    min-height: 250px; /* Reduce height */
    padding: 6px;
    border-radius: 4px;
  }

  /* Make section headings smaller */
  .section h2 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  /* Make exercise items smaller */
  .exercise-item {
    padding: 8px;
    margin: 4px 0;
    border-radius: 4px;
  }

  /* Make exercise titles smaller */
  .exercise-item h2 {
    font-size: 0.8rem;
    margin: 0 0 6px 0;
  }

  /* Make sub-exercise items smaller */
  .sub-exercise-item {
    padding: 4px 6px;
    margin: 2px 0;
    font-size: 0.7rem;
  }

  /* Make checkboxes smaller */
  .exercise-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 6px;
  }

  /* Make exercise list more compact */
  .exercise-list {
    gap: 4px;
  }

  /* Make sub-exercise list more compact */
  .sub-exercise-list {
    gap: 2px;
  }

  /* Optimize dark mode toggle for mobile */
  .dark-mode-toggle {
    top: 8px;
    right: 8px;
  }

  .toggle-container {
    width: 50px;
    height: 25px;
  }

  .toggle-label {
    width: 50px;
    height: 25px;
  }

  .toggle-circle {
    width: 21px;
    height: 21px;
  }

  .toggle-icon {
    font-size: 10px;
  }

  #toggle-dark-mode:checked + .toggle-label .toggle-circle {
    transform: translateX(25px);
  }

  /* Make reset button smaller */
  .reset-button {
    bottom: 8px;
    left: 8px;
    padding: 6px 12px;
    font-size: 0.7rem;
    border-radius: 4px;
  }
}

@media (min-width: 768px) {
  /* Desktop */
  #tit {
    font-size: 6vh;
  }
  .dark-mode-toggle {
    top: 20px;
    right: 20px;
  }

  .toggle-container {
    width: 80px;
    height: 40px;
  }

  .toggle-label {
    width: 80px;
    height: 40px;
  }

  .toggle-circle {
    width: 34px;
    height: 34px;
  }

  .toggle-icon {
    font-size: 18px;
  }

  #toggle-dark-mode:checked + .toggle-label .toggle-circle {
    transform: translateX(40px);
  }
}

/* Additional mobile optimizations for very small screens */
@media (max-width: 480px) {
  /* Even smaller for very small phones */
  body {
    padding: 2px;
  }

  #tit {
    font-size: 1.2vh;
    left: 3px;
    letter-spacing: 1px;
  }

  .day-title {
    width: 95%;
    padding: 4px 6px;
    font-size: 0.65rem;
    margin: 2px auto;
    border-radius: 6px;
    line-height: 1.1;
  }

  .day-content {
    gap: 2px;
    margin: 0 1px;
    padding-top: 2px;
    width: 99.5%;
  }

  /* Reduce spacing between workout containers even more */
  #workout-container {
    gap: 4px;
    margin-top: 50px; /* Push below dark mode toggle */
    padding-bottom: 50px; /* Even more reduced padding for very small screens */
  }

  .section {
    min-width: 49%;
    max-width: 49%;
    min-height: 200px;
    padding: 4px;
  }

  .section h2 {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  .exercise-item {
    padding: 6px;
    margin: 3px 0;
  }

  .exercise-item h2 {
    font-size: 0.75rem;
    margin: 0 0 4px 0;
  }

  .sub-exercise-item {
    padding: 3px 4px;
    margin: 1px 0;
    font-size: 0.65rem;
  }

  .exercise-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin-right: 4px;
  }

  .exercise-list {
    gap: 2px;
  }

  .sub-exercise-list {
    gap: 1px;
  }

  .dark-mode-toggle {
    top: 6px;
    right: 6px;
  }

  .toggle-container {
    width: 45px;
    height: 22px;
  }

  .toggle-label {
    width: 45px;
    height: 22px;
  }

  .toggle-circle {
    width: 18px;
    height: 18px;
  }

  .toggle-icon {
    font-size: 9px;
  }

  #toggle-dark-mode:checked + .toggle-label .toggle-circle {
    transform: translateX(23px);
  }

  .reset-button {
    bottom: 6px;
    left: 6px;
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 767px) {
  /* General mobile adjustments */
  #tit {
    font-size: 2vh;
  }
}
.reset-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 20px;
  background-color: #ff4d4d; /* Red color to indicate reset action */
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.reset-button:active {
  transform: scale(0.95);
}

/* Style the buttons */
/* .day-title {
  display: block; 
  width: 100%; 
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: hotpink; 
  background: none; 
  border: none; 
  padding: 15px; 
  margin: 40px 0; 
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
} */

/* ✅ Neumorphic Dark Mode Toggle */
.dark-mode-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ Toggle Container */
.toggle-container {
  position: relative;
  width: 80px;
  height: 40px;
}

/* ✅ Hide default checkbox */
#toggle-dark-mode {
  display: none;
}

/* ✅ Neumorphic Toggle Design */
.toggle-label {
  display: flex;
  align-items: center;
  width: 80px;
  height: 40px;
  background: #e0e0e0;
  border-radius: 50px;
  box-shadow: inset 5px 5px 10px #bebebe, inset -5px -5px 10px #ffffff;
  position: relative;
  cursor: pointer;
  transition: background 0.4s ease-in-out;
}

/* ✅ Toggle Circle */
.toggle-circle {
  width: 34px;
  height: 34px;
  position: absolute;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease-in-out, background 0.3s ease-in-out;
}

/* ✅ Enhanced Sun & Moon Icons */
.toggle-icon {
  font-size: 18px;
  position: absolute;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sun {
  color: #ffcc00;
  opacity: 1;
  transform: rotate(0deg);
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.moon {
  color: #e2e8f0;
  opacity: 0;
  transform: rotate(-180deg);
}

/* ✅ Dark Mode Active */
#toggle-dark-mode:checked + .toggle-label {
  background: #222;
  box-shadow: inset 5px 5px 10px #111, inset -5px -5px 10px #333;
}

/* ✅ Move Toggle Knob */
#toggle-dark-mode:checked + .toggle-label .toggle-circle {
  transform: translateX(40px);
  background: #181818;
}

/* ✅ Show Moon, Hide Sun */
#toggle-dark-mode:checked + .toggle-label .sun {
  opacity: 0;
}

#toggle-dark-mode:checked + .toggle-label .moon {
  opacity: 1;
}

/* ✅ Enhanced Dark Mode Styling */
body.dark-mode {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #e0e6ed;
  transition: all 0.3s ease;
}

/* ✅ Dark Mode Component Styling */

/* Dark mode gym title */
.dark-mode #tit {
  color: #64b5f6;
  text-shadow: 0 0 20px rgba(100, 181, 246, 0.3);
}

/* Dark mode main heading */
.dark-mode h1 {
  color: #ff6b9d;
  text-shadow: 0 0 15px rgba(255, 107, 157, 0.4);
}

/* Dark mode day titles */
.dark-mode .day-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark-mode .day-title:hover {
  background: linear-gradient(135deg, #764ba2 0%, #f093fb 50%, #667eea 100%);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Dark mode sections */
.dark-mode .section {
  background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
  border: 1px solid #4a5568;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Dark mode section backgrounds */
.dark-mode .section#KK {
  background: linear-gradient(145deg, #2b6cb0 0%, #2c5282 100%);
  border-color: #3182ce;
}

.dark-mode .section#VV {
  background: linear-gradient(145deg, #b83280 0%, #97266d 100%);
  border-color: #d53f8c;
}

/* Dark mode section headings */
.dark-mode .section h2 {
  color: #f7fafc;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Dark mode exercise items */
.dark-mode .exercise-item {
  background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
  border: 1px solid #4a5568;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.dark-mode .exercise-item:hover {
  background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
  border-color: #718096;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

/* Dark mode exercise titles */
.dark-mode .exercise-item h2 {
  color: #f7fafc;
}

/* Dark mode checkboxes */
.dark-mode .exercise-item input[type="checkbox"] {
  accent-color: #64b5f6;
  filter: brightness(1.2);
}

/* Dark mode sub-exercise items */
.dark-mode .sub-exercise-item {
  color: #cbd5e0;
}

/* Dark mode strike-through */
.dark-mode .strike-through {
  color: #a0aec0;
  opacity: 0.6;
}

/* Dark mode reset button */
.dark-mode .reset-button {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: #ffffff;
  border: 1px solid #fc8181;
  box-shadow: 0 4px 16px rgba(229, 62, 62, 0.3);
}

.dark-mode .reset-button:hover {
  background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

/* ✅ Dark Mode Modal Styling */
.dark-mode #resetModalContent {
  background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
  color: #e2e8f0;
  border: 1px solid #4a5568;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dark-mode #resetModalContent h2 {
  color: #f7fafc;
}

.dark-mode #resetModalContent p {
  color: #cbd5e0;
}

/* ✅ Dark Mode Focus States */
.dark-mode .day-title:focus {
  outline: 2px solid #64b5f6;
  outline-offset: 2px;
}

/* ✅ Dark Mode Scrollbar Styling */
.dark-mode ::-webkit-scrollbar {
  width: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
  background: #1a202c;
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
}

/* ✅ Enhanced Dark Mode Toggle */
#toggle-dark-mode:checked + .toggle-label {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  box-shadow: inset 5px 5px 10px #1a202c, inset -5px -5px 10px #4a5568,
    0 0 20px rgba(100, 181, 246, 0.2);
  border: 1px solid #4a5568;
}

/* ✅ Enhanced Toggle Circle */
#toggle-dark-mode:checked + .toggle-label .toggle-circle {
  transform: translateX(40px);
  background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ✅ Enhanced Sun Icon in Dark Mode */
#toggle-dark-mode:checked + .toggle-label .sun {
  opacity: 0;
  transform: rotate(180deg);
}

/* ✅ Enhanced Moon Icon in Dark Mode */
#toggle-dark-mode:checked + .toggle-label .moon {
  opacity: 1;
  transform: rotate(0deg);
  color: #64b5f6;
  text-shadow: 0 0 10px rgba(100, 181, 246, 0.5);
}

.day-title {
  display: block;
  width: 70%;
  max-width: 600px;
  background: linear-gradient(to right, lightpink, lightblue);
  color: darkblue;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 25px;
  border: none;
  border-radius: 30px;
  margin: 20px auto;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Add hover effect */
.day-title:hover {
  transform: scale(1.05); /* Slightly enlarge on hover */
  opacity: 0.8; /* Reduce opacity on hover */
}

/* Add focus effect for accessibility */
.day-title:focus {
  outline: 2px solid hotpink; /* Highlight when focused */
}

/* Ensure the .day-content displays sections side by side */
.day-content {
  display: flex;
  margin-left: 10px;
  margin-right: 10px;
  flex-wrap: nowrap; /* Prevent stacking */
  gap: 10px; /* Reduce space between sections */
  justify-content: center; /* Center the sections */
  padding-top: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-in-out;
  align-items: flex-start;
  width: 95%;
}

/* Make each section smaller */
.section {
  flex: 1;
  margin-left: 0px;
  min-width: 30%; /* Reduce minimum width */
  max-width: 35%; /* Reduce max width */
}

/* Ensure two sections appear next to each other */
.workout-day .day-content .section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Expand effect when toggling */
.workout-day.active .day-content {
  max-height: 1000px;
  opacity: 1;
}
