/* Dark mode list items */
body:has(#toggle_checkbox:checked) li {
  background: rgba(162, 155, 254, 0.1);
  border-left-color: #a29bfe;
}

body:has(#toggle_checkbox:checked) li:hover {
  background: rgba(162, 155, 254, 0.2);
}

body:has(#toggle_checkbox:checked) #resultCalcHoras {
  color: #a29bfe;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  transition: all 0.3s ease;
  color: #333;
}

/* Dark mode styles */
body:has(#toggle_checkbox:checked) {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #f1f2f6;
}

/* Header */
header {
  position: relative;
  padding: 20px 0;
}

/* Main content */
main {
  padding: 20px;
  padding-bottom: 100px;
}

/* Container styles */
.container {
  max-width: 500px;
  margin: 30px auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.container:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Dark mode container */
body:has(#toggle_checkbox:checked) .container {
  background: rgba(26, 26, 46, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(116, 185, 255, 0.1);
}

/* Headings */
h1 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
  font-weight: 600;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body:has(#toggle_checkbox:checked) h1 {
  background: linear-gradient(45deg, #a29bfe, #6c5ce7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Alignment container */
.alinhamento {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* List styles */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 15px;
}

ul::-webkit-scrollbar {
  width: 6px;
}

ul::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

ul::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

/* List items */
li {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 8px 12px;
  margin: 5px 0;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.2s ease;
}

li:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateX(5px);
}

#resultCalcHoras {
  font-weight: bold;
  font-size: 1.5rem;
  color: #667eea;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Input styles */
input[type="number"],
input[type="date"] {
  padding: 12px 16px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  width: 200px;
  margin: 5px;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  outline: none;
}

/* Remove those fucking arrows from number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]:focus,
input[type="date"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

input[type="number"]::placeholder {
  color: rgba(102, 126, 234, 0.6);
  font-weight: 500;
}

/* Dark mode inputs */
body:has(#toggle_checkbox:checked) input[type="number"],
body:has(#toggle_checkbox:checked) input[type="date"] {
  background: rgba(26, 26, 46, 0.8);
  border-color: rgba(162, 155, 254, 0.3);
  color: #f1f2f6;
}

body:has(#toggle_checkbox:checked) input[type="number"]:focus,
body:has(#toggle_checkbox:checked) input[type="date"]:focus {
  border-color: #a29bfe;
  box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.2);
}

/* Button container for proper alignment */
.alinhamento > div:last-child {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Button styles */
button {
  margin: 5px;
  padding: 12px 24px;
  cursor: pointer;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  min-width: 100px;
}

button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

/* Delete button */
.delete-button {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
  padding: 8px 16px;
  font-size: 0.9rem;
}

.delete-button:hover {
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Input container for better alignment */
.alinhamento > div:not(:last-child) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Special alignment for date inputs in "Calculadora de Dias" */
.alinhamento > #column > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
}

/* Column layout */
#column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 10px;
  width: 100%;
}

/* Day/Night toggle styles */
.button-dayNight {
  position: fixed;
  bottom: 30px;
  left: 30px;
  user-select: none;
  z-index: 1000;
}

#toggle_checkbox {
  display: none;
}

#checkBoxLabel {
  display: block;
  position: relative;
  width: 80px;
  height: 40px;
  background: linear-gradient(45deg, #87ceeb, #4682b4);
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#checkBoxLabel:hover {
  transform: scale(1.05);
}

#star {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #ffd700, #ffa500);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#star-1,
#star-2 {
  position: absolute;
  font-size: 16px;
  color: #ffa500;
  transition: all 0.3s ease;
}

#star-2 {
  transform: rotate(36deg);
}

#moon {
  position: absolute;
  bottom: -35px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 30% 30%, #f5f5f5, #e0e0e0);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.1);
}

/* FIXED: Moon shadow effect - only visible in dark mode */
#moon::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -10px;
  width: 24px;
  height: 24px;
  background: transparent; /* Default to transparent in light mode */
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* Checked state */
#toggle_checkbox:checked + label {
  background: linear-gradient(45deg, #2c3e50, #34495e);
}

#toggle_checkbox:checked + label #star {
  left: 48px;
  transform: scale(0.6);
  background: radial-gradient(circle, #fff8dc, #f0e68c);
}

#toggle_checkbox:checked + label .star {
  color: #f0e68c;
  font-size: 12px;
}

#toggle_checkbox:checked + label #moon {
  bottom: 8px;
}

/* FIXED: Only show moon shadow in dark mode */
#toggle_checkbox:checked + label #moon::before {
  background: linear-gradient(45deg, #2c3e50, #34495e);
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    margin: 20px;
    padding: 25px;
    border-radius: 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  input[type="number"],
  input[type="date"] {
    width: 100%;
    max-width: 250px;
  }

  .alinhamento > div:last-child {
    flex-direction: column;
    width: 100%;
  }

  button {
    width: 100%;
    max-width: 200px;
    margin: 5px 0;
  }

  .alinhamento > div:not(:last-child) {
    flex-direction: column;
    width: 100%;
  }

  #column {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 480px) {
  main {
    padding: 10px;
  }

  .container {
    margin: 15px;
    padding: 20px;
  }

  .button-dayNight {
    bottom: 20px;
    left: 20px;
  }

  #checkBoxLabel {
    width: 70px;
    height: 35px;
  }

  #star {
    width: 21px;
    height: 21px;
    top: 7px;
    left: 7px;
  }

  #moon {
    width: 21px;
    height: 21px;
    right: 7px;
  }
}

/* Animation for page load */
.container {
  animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Loading animation for buttons */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

button.loading {
  animation: pulse 1s infinite;
}
