/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader.hidden {
  display: none;
}

.spinner {
  width: 3em;
  height: 3em;
  cursor: not-allowed;
  border-radius: 50%;
  border: 2px solid #444;
  box-shadow: -10px -10px 10px #6359f8, 0px -10px 10px 0px #9c32e2,
    10px -10px 10px #f36896, 10px 0 10px #ff0b0b, 10px 10px 10px 0px#ff5500,
    0 10px 10px 0px #ff9500, -10px 10px 10px 0px #ffb700;
  animation: rot55 0.7s linear infinite;
}

.spinnerin {
  border: 2px solid #444;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes rot55 {
  to {
    transform: rotate(360deg);
  }
}

/* Base styles */
* {
  box-sizing: border-box;
}

html {
  background: #0a0a0a;
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #0f0f0f);
  color: #f1f1f1;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "Roboto", "Helvetica Neue", "Arial", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Extended gradient coverage for overscroll areas */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #0f0f0f);
  z-index: -1;
}

main {
  padding: 1.8rem 2rem 3rem;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* Responsive typography */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  label {
    font-size: 0.9rem;
  }

  .dropdown-toggle {
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
  }

  .quick-actions h3 {
    font-size: 1rem;
  }

  .action-text {
    font-size: 0.8rem;
  }

  .notification {
    font-size: 0.85rem;
    padding: 12px 18px;
  }
}

@media (max-width: 360px) {
  body {
    font-size: 14px;
  }

  main {
    padding: 1.5rem 1.5rem 3rem;
  }

  .nav-title {
    font-size: 0.9rem;
  }

  .popupContent {
    padding: 0.8rem 1rem;
    max-width: 280px;
  }

  .popupContent h2 {
    font-size: 0.9rem;
    margin: 0 0 0.4rem;
  }

  .popup-icon {
    width: 1.3em;
    height: 1em;
  }

  .popupContent button {
    padding: 5px 10px;
    font-size: 0.7rem;
    margin-top: 0.6rem;
  }
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 1.5rem;
  color: #f1f1f1;
  z-index: 1000;
}

.nav-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon {
  width: 24px;
  height: 24px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.settings-btn {
  font-size: 2.5rem;
}

.nav-title {
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
  letter-spacing: -0.03em;
  color: #f8f8f8;
}

/* Color picker and swatches */
#color-picker-ui {
  display: flex;
  justify-content: center;
  margin: 1rem auto;
  max-width: 400px;
  width: 100%;
}

.swatchGrid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 400px;
  justify-content: center;
  margin: 0 auto;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.swatch:hover {
  border-color: #fff;
  transform: scale(1.1);
}

/* Swatch background colors */
.swatch[data-color="#ff0000"] {
  background: #ff0000;
}

.swatch[data-color="#00FF00"] {
  background: #00FF00;
}

.swatch[data-color="#0000FF"] {
  background: #0000FF;
}

.swatch[data-color="#00FFFF"] {
  background: #00FFFF;
}

.swatch[data-color="#FF00FF"] {
  background: #FF00FF;
}

.swatch[data-color="#ffffff"] {
  background: #ffffff;
}

/* Form elements */
label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e0e0e0;
  text-transform: none;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.label-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4db8ff;
  cursor: pointer;
  border: none;
  margin-top: 0;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4db8ff;
  cursor: pointer;
  border: none;
}

/* Effects section */
.effects-section {
  padding-bottom: 350px;
}

.effects-section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8f8f8;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.section-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  opacity: 0.9;
  transform: scale(1.25);
  /* Scale up Bootstrap icons to match other icons */
}

.effects-bar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.effects-bar label {
  margin-bottom: 0.5rem;
}

/* Dropdown */
.effect-dropdown {
  position: relative;
  user-select: none;
}

.dropdown-toggle {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f8f8f8;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-align: left;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
  line-height: 1.3;
  gap: 0.8rem;
}

.dropdown-icon {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  transform: scale(1.125);
  /* Scale up Bootstrap icons to match other icons */
}

.dropdown-text {
  flex: 1;
}

.dropdown-toggle:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: #4db8ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.8rem;
  color: #888;
  margin-left: 0.5rem;
}

.effect-dropdown.open .arrow {
  transform: rotate(180deg);
  color: #4db8ff;
}

.dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.5rem;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
  position: absolute;
  width: 100%;
  z-index: 999;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.effect-dropdown.open .dropdown-list {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.effect-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  border-radius: 6px;
  color: #f1f1f1;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  user-select: none;
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.effect-icon {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  transform: scale(1.125);
  /* Scale up Bootstrap icons to match other icons */
}

.effect-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(77, 184, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.effect-btn:hover::before {
  left: 100%;
}

.effect-btn:hover {
  background: rgba(30, 30, 30, 0.9);
  color: #f1f1f1;
  transform: translateX(4px);
}

.effect-btn.active {
  background: #4db8ff;
  color: #121212;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(77, 184, 255, 0.3);
}

/* Quick actions */
.quick-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-actions h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8f8f8;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f1f1f1;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.action-btn:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: #4db8ff;
  transform: translateY(-2px);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn.active {
  border-color: #4db8ff;
  background: #3a3a3a;
  box-shadow: 0 0 0 2px rgba(77, 184, 255, 0.3);
}

.action-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.action-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  color: #f8f8f8;
  font-weight: 600;
  padding: 14px 22px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
  font-size: 0.9rem;
  max-width: 300px;
  z-index: 10000;
  user-select: none;
  box-sizing: border-box;
  letter-spacing: -0.01em;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  touch-action: pan-y;
}

.notification.error {
  background: rgba(220, 53, 69, 0.9);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 150, 150, 0.3);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.3);
}

.notification-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  opacity: 0.9;
}

.notification-text {
  flex: 1;
}

.notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notification-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  line-height: 1.2;
}

.notification-text {
  font-weight: 500;
  font-size: 0.8rem;
  color: #f0f0f0;
  line-height: 1.3;
}

.notification.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Popup */
.popupBox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popupBox.visible {
  opacity: 1;
  pointer-events: auto;
}

.popupContent {
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  max-width: 320px;
  width: 85%;
  text-align: center;
  color: #f1f1f1;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.popupContent button {
  margin-top: 0.8rem;
  background: #4db8ff;
  border: 1.5px solid transparent;
  padding: 6px 12px;
  font-weight: 600;
  color: #121212;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.75rem;
}

.popupContent button:active {
  background: transparent;
  border: 1.5px solid #4db8ff;
  color: #4db8ff;
}

.popupContent h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #f8f8f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}

.popup-icon {
  width: 1.5em;
  height: 1.2em;
  flex-shrink: 0;
  opacity: 0.9;
  transform: scale(1.25);
  /* Scale up Bootstrap icons to match other icons */
}
