/* Base Template Additional Styles */
/* Global responsive styles */
.w3-card-4 {
  margin: 10px;
  max-width: 100%;
}

/* Make inputs more touch-friendly on mobile */
input[type="range"] {
  width: 100%;
  max-width: 300px;
  height: 30px;
  /* Larger touch target */
}

/* Responsive buttons */
.w3-button {
  margin: 5px;
  display: inline-block;
  width: auto;
  border-radius: 8px;
}

/* Left side hamburger menu styles */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
  z-index: 1002;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  order: -1; /* Ensure it appears first */
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--page-text);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger.active {
  display: none;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.mobile-menu-overlay.active {
  display: block;
}

/* Left side sliding panel */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: var(--content-bg);
  z-index: 1001;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
  transition: left 0.3s ease-in-out;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu h1 {
  margin: 0;
  color: var(--header-text-color);
  font-size: 1.2em;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--page-text);
  cursor: pointer;
  padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu ul li {
  margin-bottom: 0.5rem;
}

.mobile-menu ul li a {
  display: block;
  padding: 1rem;
  color: var(--link-color);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s;
  border: 1px solid var(--border-color);
}

.mobile-menu ul li a:hover {
  background: var(--secondary-color);
}

.mobile-menu .theme-toggle-container {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.mobile-menu .theme-toggle {
  justify-content: center;
  margin-left: 0;
  padding: 1rem;
}

/* Media queries for different screen sizes */
@media screen and (max-width: 768px) {
  /* General mobile improvements */
  body {
    padding: 0.5rem;
  }

  .content {
    padding: 0 0.5rem 0.5rem;
  }

  /* Show hamburger menu on mobile */
  .hamburger {
    display: flex;
  }

  /* Hide desktop navigation on mobile */
  nav ul {
    display: none;
  }

  /* Keep nav title visible and centered */
  nav h1 {
    flex: 1;
    margin: 0;
    text-align: center;
  }

  /* Ensure proper spacing between hamburger and title */
  nav {
    gap: 0.5rem;
  }
}

@media screen and (max-width: 600px) {
  .w3-button {
    width: 100%;
    margin: 5px 0;
  }

  h1 {
    font-size: 1.5em;
  }

  .w3-padding {
    padding: 8px !important;
  }
}

#brightness {
  width: 100%;
  max-width: 300px;
  margin: 10px 0;
}

#default_interval {
  width: 100%;
  max-width: 300px;
  margin: 10px 0;
}
