:root {
  --bg-app: #f5f0e7;
  --bg-panel: #f5f0e7;
  --text-main: #313439;
  --text-muted: #313439;
  --accent: #9d2732;
  --accent-hover: #b93a46;
  --border: #2f343e;
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --font-main: "Outfit", sans-serif;
  --shadow-smooth: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  margin-bottom: 3rem;
}

.header-logo {
  width: 164px;
  height: auto;
  margin-bottom: 1rem;
}

.app-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-header p {
  color: var(--text-muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
}

/* Visualizer Panel */
.visualizer-panel {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  box-shadow: var(--shadow-smooth);
  background-image:
    linear-gradient(45deg, #242830 25%, transparent 25%),
    linear-gradient(-45deg, #242830 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #242830 75%),
    linear-gradient(-45deg, transparent 75%, #242830 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0px;
}

.canvas-wrapper {
  /* Identify the wrapper for background color changes */
  padding: 2rem;
  border-radius: var(--radius-md);
  transition: background-color 0.3s ease;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.canvas-wrapper.transparent-bg {
  background-color: transparent;
}

.svg-container {
  width: 100%;
  max-width: 500px;
  height: auto;
}

.svg-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* Controls Panel */
.controls-panel {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-shadow: var(--shadow-smooth);
  height: fit-content;
}

.control-group h2,
.action-group h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Color Pickers */
.color-picker-item {
  margin-bottom: 1.25rem;
}

.color-picker-item label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 0;
}

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

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hex-value {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.label-text {
  font-size: 0.9rem;
}

/* Buttons */
.button-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.icon {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Transitions */
#bgColorControl {
  transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .visualizer-panel {
    min-height: 300px;
  }
}

.app-footer {
  text-align: center;
  margin-top: 3rem;
  padding-bottom: 2rem;
}

.license-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.license-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.license-link img {
  border-radius: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.store-link {
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.store-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
