/* Main Stylesheet for CircleForms */

@import url("layout.css");
@import url("components.css");

/* Add any page-specific overrides or additional global styles below */
/* --- Mobile Navigation --- */

/* Hamburger Menu Button */
.mobile-nav-toggle {
  display: none; /* Hidden by default */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-nav-toggle .material-symbols-outlined {
  font-size: 2.5rem;
  color: #333;
  vertical-align: middle;
}

/* Bottom Navigation Bar */
.bottom-nav {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-top: 1px solid #eee;
}

.bottom-nav-list {
  display: flex;
  justify-content: space-around;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.bottom-nav-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #606770;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.bottom-nav-item a .material-symbols-outlined {
  font-size: 1.75rem;
  margin-bottom: 2px;
}

.bottom-nav-item a.active {
  color: #007bff;
}

/* Media Query for Mobile */
@media (max-width: 768px) {
  body > header {
    position: relative; /* For positioning context */
    /* Override the responsive styles from layout.css to keep a single-row header */
    flex-direction: row;
    height: 60px;
    padding: 0 1rem;
  }

  body > header h1 {
    /* Center the title absolutely within the header on mobile */
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  body > header nav {
    display: none; /* Hide desktop nav */
    flex-direction: column;
    position: absolute;
    top: 60px; /* Match header height */
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 1000;
  }

  body > header nav.mobile-active {
    display: flex; /* Show it when active */
  }

  body > header nav a,
  body > header nav .btn {
    padding: 0.75rem 0;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    width: 100%;
    border-radius: 0;
  }

  body > header nav .btn {
    margin-top: 1rem;
    border-bottom: none;
  }

  .mobile-nav-toggle {
    display: block; /* Show hamburger */
  }

  .bottom-nav {
    display: block; /* Show bottom nav */
  }

  /* Add padding to the bottom of the main content to avoid overlap with bottom nav */
  main {
    padding-bottom: 80px;
  }
}

/* ===============================
   Custom Toggle Switch
=============================== */
.switch {
  /* switch */
  --switch-width: 46px;
  --switch-height: 24px;
  --switch-bg: rgb(131, 131, 131);
  --switch-checked-bg: rgb(0, 218, 80);
  --switch-offset: calc((var(--switch-height) - var(--circle-diameter)) / 2);
  --switch-transition: all 0.2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  /* circle */
  --circle-diameter: 18px;
  --circle-bg: #fff;
  --circle-shadow: 1px 1px 2px rgba(146, 146, 146, 0.45);
  --circle-checked-shadow: -1px 1px 2px rgba(163, 163, 163, 0.45);
  --circle-transition: var(--switch-transition);
  /* icon */
  --icon-transition: all 0.2s cubic-bezier(0.27, 0.2, 0.25, 1.51);
  --icon-cross-color: var(--switch-bg);
  --icon-cross-size: 6px;
  --icon-checkmark-color: var(--switch-checked-bg);
  --icon-checkmark-size: 10px;
  /* effect line */
  --effect-width: calc(var(--circle-diameter) / 2);
  --effect-height: calc(var(--effect-width) / 2 - 1px);
  --effect-bg: var(--circle-bg);
  --effect-border-radius: 1px;
  --effect-transition: all 0.2s ease-in-out;
}

.switch input {
  display: none;
}

.switch {
  display: inline-block;
}

.switch svg {
  -webkit-transition: var(--icon-transition);
  -o-transition: var(--icon-transition);
  transition: var(--icon-transition);
  position: absolute;
  height: auto;
}

.switch .checkmark {
  width: var(--icon-checkmark-size);
  color: var(--icon-checkmark-color);
  -webkit-transform: scale(0);
  -ms-transform: scale(0);
  transform: scale(0);
}

.switch .cross {
  width: var(--icon-cross-size);
  color: var(--icon-cross-color);
}

.slider {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: var(--switch-width);
  height: var(--switch-height);
  background: var(--switch-bg);
  border-radius: 999px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  position: relative;
  -webkit-transition: var(--switch-transition);
  -o-transition: var(--switch-transition);
  transition: var(--switch-transition);
  cursor: pointer;
}

.circle {
  width: var(--circle-diameter);
  height: var(--circle-diameter);
  background: var(--circle-bg);
  border-radius: inherit;
  -webkit-box-shadow: var(--circle-shadow);
  box-shadow: var(--circle-shadow);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-transition: var(--circle-transition);
  -o-transition: var(--circle-transition);
  transition: var(--circle-transition);
  z-index: 1;
  position: absolute;
  left: var(--switch-offset);
}

.slider::before {
  content: "";
  position: absolute;
  width: var(--effect-width);
  height: var(--effect-height);
  left: calc(var(--switch-offset) + (var(--effect-width) / 2));
  background: var(--effect-bg);
  border-radius: var(--effect-border-radius);
  -webkit-transition: var(--effect-transition);
  -o-transition: var(--effect-transition);
  transition: var(--effect-transition);
}

/* actions */
.switch input:checked + .slider {
  background: var(--switch-checked-bg);
}

.switch input:checked + .slider .checkmark {
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
}

.switch input:checked + .slider .cross {
  -webkit-transform: scale(0);
  -ms-transform: scale(0);
  transform: scale(0);
}

.switch input:checked + .slider::before {
  left: calc(
    100% - var(--effect-width) - (var(--effect-width) / 2) -
      var(--switch-offset)
  );
}

.switch input:checked + .slider .circle {
  left: calc(100% - var(--circle-diameter) - var(--switch-offset));
  -webkit-box-shadow: var(--circle-checked-shadow);
  box-shadow: var(--circle-checked-shadow);
}

/* ===============================
   Admin Panel Layout
=============================== */
body.admin-page {
  display: flex;
  background-color: #f8f9fa;
}

.admin-sidebar {
  width: 250px;
  background-color: #111827; /* Dark gray */
  color: #d1d5db; /* Light gray text */
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.admin-sidebar-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid #374151; /* Medium gray */
}

.admin-sidebar-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
  flex-grow: 1;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: #d1d5db;
  text-decoration: none;
  font-size: 1rem;
  transition:
    background-color 0.2s,
    color 0.2s;
  border-left: 3px solid transparent;
}

.admin-sidebar-nav a:hover {
  background-color: #374151;
  color: #fff;
}

.admin-sidebar-nav a.active {
  background-color: #1f2937;
  color: #fff;
  font-weight: 600;
  border-left-color: #4f46e5; /* Indigo */
}

.admin-sidebar-nav a .material-symbols-outlined {
  font-size: 1.5rem;
}

.admin-sidebar-exit {
  margin-top: auto;
  border-top: 1px solid #374151;
}

.admin-main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 2rem;
}

/* Remove user header/footer from admin pages */
body.admin-page > header,
body.admin-page > footer,
body.admin-page .bottom-nav {
  display: none !important;
}
