/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  overflow: hidden;
  background-color: #000;
  color: #fff;
  width: 100vw;
  height: 100vh;
}

/* Display Screen Container */
.display-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #000;
  transition: background 0.4s ease;
  position: relative;
}

/* Marquee Track */
.marquee-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Text Display Styles */
.text-display {
  white-space: nowrap;
  font-size: 30vh;
  color: #ff0055;
  text-shadow: 0 0 15px #ff0055;
  padding: 0 4vw;
  will-change: transform;
  display: inline-block;
  line-height: 1;
}

/* When centering text (no-scrolling) */
.marquee-track.centered {
  justify-content: center;
}
.marquee-track.centered .text-display {
  transform: none !important;
  animation: none !important;
  text-align: center;
  padding: 0;
}

/* CSS Keyframes for smooth GPU-accelerated marquee scrolling */
@keyframes marquee-rtl {
  0% {
    transform: translate3d(var(--start-x), 0, 0);
  }
  100% {
    transform: translate3d(var(--end-x), 0, 0);
  }
}

@keyframes marquee-ltr {
  0% {
    transform: translate3d(var(--end-x), 0, 0);
  }
  100% {
    transform: translate3d(var(--start-x), 0, 0);
  }
}

/* Float Action Buttons */
.float-btn {
  position: fixed;
  z-index: 100;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.float-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: scale(1.1);
}

#toggle-settings-btn {
  bottom: 24px;
  left: 24px;
}

#fullscreen-btn {
  bottom: 24px;
  right: 24px;
}

/* Glassmorphism Settings Sidebar */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 100%;
  background: rgba(15, 22, 36, 0.75);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(0);
}

.settings-panel.hidden {
  transform: translateX(-100%);
}

.settings-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(90deg, #00f3ff, #ff0055);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #ff0055;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Customize scrollbar in sidebar */
.settings-body::-webkit-scrollbar {
  width: 6px;
}
.settings-body::-webkit-scrollbar-track {
  background: transparent;
}
.settings-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.settings-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.settings-row {
  display: flex;
  gap: 16px;
}

.settings-group.half {
  flex: 1;
}

/* Inputs & Form Controls */
textarea, select, input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: all 0.3s;
}

textarea:focus, select:focus, input[type="text"]:focus {
  border-color: rgba(0, 243, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.15);
}

textarea {
  resize: vertical;
}

/* Preset Themes Grid */
.theme-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 4px;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.theme-chip::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 5px var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.theme-chip.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: #00f3ff;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Color Picker Customization */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 10px;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.color-code {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Range Slider Styles */
.label-with-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-with-val span {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #00f3ff;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  margin: 12px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #00f3ff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
  transition: all 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #fff;
}

/* Checkbox Styles */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.05);
}

.checkbox-row input[type="checkbox"]:checked {
  background: #00f3ff;
  border-color: #00f3ff;
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: '✓';
  color: #000;
  font-size: 11px;
  font-weight: bold;
}

.checkbox-row label {
  margin-bottom: 0 !important;
  cursor: pointer;
}

/* Custom Font File Wrapper */
.custom-font-wrapper {
  margin-top: 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.02);
}

.custom-font-wrapper:hover {
  border-color: #00f3ff;
  background: rgba(0, 243, 255, 0.05);
}

.custom-font-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-info {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  word-break: break-all;
}

/* Help Box */
.settings-help {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.settings-help h4 {
  font-size: 0.85rem;
  color: #ff0055;
  margin-bottom: 8px;
}

.settings-help ul {
  list-style: none;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.settings-help li {
  margin-bottom: 6px;
  line-height: 1.4;
  position: relative;
  padding-left: 12px;
}

.settings-help li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #ff0055;
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

/* Responsive adjustments for narrow/mobile screens */
@media (max-width: 480px) {
  .settings-panel {
    width: 100%;
  }
}
