/* QUOTE APP STYLES */

:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --border: #333333;
  --text: #ede8df;
  --text-dim: rgba(237, 232, 223, 0.5);
  --accent: #00ffcc;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  height: 60px;
  flex-shrink: 0;
}

.app-nav__back {
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.app-nav__back:hover {
  color: var(--accent);
}

.app-nav__brand {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text);
}


.app-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  padding: 1rem;
  gap: 1rem;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   CONTROLS PANEL
══════════════════════════════════════════════════════════ */
.controls-panel {
  width: 450px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: space-between;
}

.panel-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.control-group.full {
  grid-column: 1 / -1;
}

.control-group.split {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.panel-header h2 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(0, 255, 204, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-group.split {
  flex-direction: row;
  gap: 0.75rem;
}
.control-group.split > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

input[type="text"],
textarea,
select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 50px;
}

.file-upload-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.file-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  text-align: left;
}

.hidden-file-input {
  display: none;
}

small {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

.align-buttons {
  display: flex;
  gap: 0.5rem;
}

.align-btn, .pos-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.align-btn:hover, .pos-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.align-btn.active, .pos-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 40px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  outline: none;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  cursor: pointer;
  border-radius: 50%;
}

.btn-primary {
  grid-column: 1 / -1;
  margin-top: auto;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 1rem;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}
.btn-primary:hover {
  opacity: 0.8;
}

/* ══════════════════════════════════════════════════════════
   PREVIEW AREA
══════════════════════════════════════════════════════════ */
.preview-area {
  flex: 1;
  background: var(--bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

/* The frame to capture */
.capture-frame {
  position: relative;
  width: 1080px;
  height: 1080px;
  background: #111;
  transform-origin: center center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  /* Transform origin for responsive scaling */
  transform-origin: center center;
  flex-shrink: 0;
}

/* Background layers */
.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
}

/* Text Content */
.text-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 48px;
}

blockquote {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
  white-space: pre-wrap;
}

cite {
  font-style: normal;
  opacity: 0.8;
  font-size: 0.5em;
  font-weight: 400;
}

/* Alignment & Positioning Classes */
.align-left .text-content { text-align: left; }
.align-center .text-content { text-align: center; }
.align-right .text-content { text-align: right; }

.pos-top { justify-content: flex-start; }
.pos-center { justify-content: center; }
.pos-bottom { justify-content: flex-end; }

/* Watermarks */
.watermark-left {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 3;
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  color: #ffffff;
  opacity: 0.5;
  letter-spacing: 0.05em;
}

.watermark-right {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 3;
}

.watermark-right img {
  opacity: 0.4;
  display: block;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body {
    height: auto;
    overflow: auto;
  }
  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .controls-panel {
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  .preview-area {
    padding: 1rem;
    flex: none;
  }
}
