/* === FONT SETUP === */
/* Instrument Sans is loaded via Google Fonts in index.html */

/* === BRANDING STYLES === */
.branding-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px;
}

.branding-line {
  width: 100%;
  height: 0;
  background-color: #283420;
  outline: 1px solid #283420;
  outline-offset: -0.49px;
}

.branding-text-container {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.branding-text {
  color: #283420;
  font-family: "Instrument Sans", sans-serif;
  font-size: 17px;
  font-weight: 550;

  font-variation-settings: "wdth" 85;
  text-transform: uppercase;
  line-height: 1.375;
  letter-spacing: 0.05em;
}

/* External Link Styling */
.external-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.external-link-arrow {
  margin-left: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.external-link:hover .external-link-arrow {
  opacity: 1;
  transform: translateY(0);
}

/* Info Section */
.info-container {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
}

.info-popup {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #1f2937;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.info-container:hover .info-popup {
  opacity: 1;
  visibility: visible;
}

.info-popup-link {
  text-decoration: underline;
}

.hover-gap {
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
}

/* === DESIGN TOKENS === */
:root {
  /* Brand Colors */
  --primary-black: #000000;
  --primary-white: #ffffff;
  --canvas-bg: #b4b4b4;
  --body-bg: #c5c5ab;

  /* Shadows for elevation */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-base: all 0.2s ease;

  /* Canvas dimensions (set dynamically by JS) */
  --canvas-width: 800px;
  --canvas-height: 600px;
}

/* === BASE STYLES === */
body {
  font-family: "Instrument Sans", sans-serif;
  overscroll-behavior: none;
  background: var(--body-bg);
  overflow: hidden; /* Prevent scrollbar from appearing */
  height: 100vh; /* Ensure body takes full viewport height */
  margin: 0; /* Remove default margin */
}

/* === CUSTOM FONT VARIATIONS === */
.pill-font {
  font-variation-settings: "wdth" 80;
}

.extra-condensed-font {
  font-variation-settings: "wdth" 50;
  font-weight: 500;
}

/* === CANVAS STYLES === */
.p5Canvas {
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  /* Preserve canvas intrinsic aspect to avoid stretch */
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  background: var(--canvas-bg);
}

/* === CANVAS CONTAINER === */
.canvas-container {
  box-shadow: none; /* shadow is on the canvas element */
  width: min(var(--canvas-width), calc(100% - 2rem));
  height: min(var(--canvas-height), calc(100% - 2rem));
  margin: auto;
  background: transparent;
}

.canvas-layer {
  transition: opacity var(--transition-base);
}

.canvas-area {
  background: var(--canvas-bg);
}

/* === CONTROL PANEL === */
.control-panel {
  background: var(--primary-white);
  border-radius: 1rem;
  overflow: hidden;
}

/* Ensure inner scrolling region hides scrollbar across browsers */
.control-panel .hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.control-panel .hide-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* === TABS === */
.tabs-container {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
}

.tab-button {
  flex: 1;
  padding: 1rem;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 0.875rem;
  color: #666;
  cursor: pointer;
  transition: var(--transition-base);
}

.tab-button.active {
  color: var(--primary-black);
  border-bottom-color: var(--primary-black);
}

/* === FORM ELEMENTS === */
.form-input {
  width: 100%;
  padding: 0.75rem;
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition-base);
}

/* Add extra padding for select elements */
select.form-input {
  padding-right: 2.5rem; /* More space for the dropdown arrow */
  appearance: none; /* Remove default arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
}

.form-input:hover {
  border-color: #e5e5e5;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-black);
}

/* Range Input Styling */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: #e5e5e5;
  border-radius: 1px;
  margin: 1rem 0;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-black);
  cursor: pointer;
  transition: var(--transition-base);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* === BUTTONS === */
.btn-base {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
}

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

.btn-secondary {
  background: #f5f5f5;
  color: var(--primary-black);
  border: 1px solid #e5e5e5;
}

/* === SCROLLBAR HIDING === */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Empty media state */
#mediaUploadsContainer {
  background: #f9f9f9;
  border: 2px dashed #e5e5e5;
  border-radius: 0.5rem;
  transition: var(--transition-base);
}

#mediaUploadsContainer:hover {
  border-color: #d1d1d1;
}

#emptyMediaPlaceholder {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 2rem;
  text-align: center;
  user-select: none;
}
