/* Camino Creator styles */

:root {
  --ink: #0a0e17;
  --teal: #00ffd1;
  --white: #ffffff;
  --secondary: #a0aec0;
  --muted: #718096;
  --surface: #121826;
  --surface-border: rgba(255, 255, 255, 0.1);
  --input-bg: #1a2234;
  --input-border: rgba(255, 255, 255, 0.15);
  --pill-bg: rgba(0, 255, 209, 0.08);
  --pill-border: rgba(0, 255, 209, 0.3);
  --alert-red-bg: rgba(229, 62, 62, 0.15);
  --alert-red-border: #e53e3e;
  --alert-red-text: #fc8181;
  --alert-green-bg: rgba(0, 255, 209, 0.1);
  --alert-green-border: #00ffd1;
  --alert-green-text: #00ffd1;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px 80px 16px;
}

/* Header */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand svg {
  width: 32px;
  height: auto;
  flex: none;
}

.header-title-wrap {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--white);
}

.header-subtitle {
  font-size: 13px;
  color: var(--secondary);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

.version-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
}

/* Section cards */
.creator-section {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--secondary);
}

/* Forms and Inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--white);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--teal);
}

.quick-fill-box {
  background: rgba(0, 255, 209, 0.04);
  border: 1px dashed var(--pill-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.quick-fill-box .hint {
  font-size: 12px;
  color: var(--secondary);
  margin-bottom: 8px;
}

.quick-fill-row {
  display: flex;
  gap: 10px;
}

.quick-fill-row input {
  flex: 1;
}

/* Photo Upload & Pan/Zoom */
.upload-dropzone {
  border: 2px dashed var(--input-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--teal);
  background: rgba(0, 255, 209, 0.05);
}

.upload-dropzone p {
  font-size: 13px;
  color: var(--secondary);
  margin-top: 6px;
}

.upload-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}

.upload-controls label {
  font-size: 12px;
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-controls input[type="range"] {
  accent-color: var(--teal);
  cursor: pointer;
}

/* Permission Checkbox */
.permission-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.permission-box input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  margin-top: 2px;
  cursor: pointer;
  flex: none;
}

.permission-box label {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.4;
  cursor: pointer;
}

/* Preview Section */
.preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preview-tab.active {
  background: var(--pill-bg);
  border-color: var(--teal);
  color: var(--teal);
}

.preview-viewport-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000000;
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.preview-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  background: var(--ink);
}

.preview-frame.card-aspect {
  width: 340px;
  height: 425px; /* 340 * (1350/1080) = 425 */
}

.preview-frame.story-aspect {
  width: 270px;
  height: 480px; /* 270 * (1920/1080) = 480 */
}

/* Export Stage (Hidden in browser) */
#export-stage {
  position: absolute;
  left: -9999px;
  top: 0;
  pointer-events: none;
}

/* Brand Card Canvas Common */
.brand-card {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  box-sizing: border-box;
}

.brand-card img.card-bg-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.1s ease;
}

/* 1080x1350 Card Specification */
.card-1080 {
  width: 1080px;
  height: 1350px;
}

.card-1080 .card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    var(--ink) 0%,
    rgba(10, 14, 23, 0.94) 20%,
    rgba(10, 14, 23, 0.7) 38%,
    rgba(10, 14, 23, 0.0) 55%);
}

.card-1080 .visor-mark {
  position: absolute;
  left: 56px;
  bottom: 56px;
  height: 56px;
  width: auto;
}

.card-1080 .handle {
  position: absolute;
  right: 56px;
  bottom: 68px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--muted);
}

.card-1080 .content {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 150px;
}

.card-1080 .labels {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--secondary);
  margin-bottom: 18px;
}

.card-1080 .rider-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 96px;
  line-height: 1.0;
  color: var(--white);
  margin-bottom: 14px;
  text-transform: uppercase;
  word-break: break-word;
}

.card-1080 .result-line {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: var(--teal);
  text-transform: uppercase;
}

/* 1080x1920 Story Specification */
.story-1080 {
  width: 1080px;
  height: 1920px;
}

.story-1080 .gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 620px;
  background: linear-gradient(to bottom, rgba(10,14,23,0.92) 0%, rgba(10,14,23,0.55) 55%, rgba(10,14,23,0) 100%);
}

.story-1080 .gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 750px;
  background: linear-gradient(to top, rgba(10,14,23,0.95) 0%, rgba(10,14,23,0.75) 50%, rgba(10,14,23,0) 100%);
}

.story-1080 .safe-content {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 350px;
}

.story-1080 .labels {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--secondary);
  margin-bottom: 20px;
}

.story-1080 .rider-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 96px;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 16px;
  text-transform: uppercase;
  word-break: break-word;
}

.story-1080 .result-line {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 44px;
  color: var(--teal);
  text-transform: uppercase;
}

.story-1080 .safe-bottom-bar {
  position: absolute;
  bottom: 250px;
  left: 72px;
  right: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-1080 .visor-mark {
  height: 56px;
  width: auto;
}

.story-1080 .handle {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--muted);
}

/* Quote Plate Overlay */
.quote-plate {
  background: #ffffff;
  color: var(--ink);
  padding: 24px 30px;
  border-radius: 12px;
  margin-bottom: 24px;
  max-width: 800px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.quote-plate .quote-text {
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.35;
  color: #0a0e17;
  margin-bottom: 10px;
}

.quote-plate .quote-author {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #4a5568;
  text-transform: uppercase;
}

/* Scaled Preview Inner */
.preview-inner-scale {
  transform-origin: top left;
  pointer-events: none;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: #33ffd9;
  box-shadow: 0 0 12px rgba(0, 255, 209, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
  color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: auto;
}

.btn-danger {
  background: rgba(229, 62, 62, 0.2);
  border: 1px solid var(--alert-red-border);
  color: var(--alert-red-text);
}

/* Captions Section */
.caption-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.caption-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
}

.caption-tab.active {
  background: var(--pill-bg);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 600;
}

.caption-textarea {
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
  resize: vertical;
  outline: none;
}

.caption-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--secondary);
}

/* Alerts and flags */
.banned-alert {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.banned-alert.red-flag {
  background: var(--alert-red-bg);
  border: 1px solid var(--alert-red-border);
  color: var(--alert-red-text);
}

.banned-alert.success {
  background: var(--alert-green-bg);
  border: 1px solid var(--alert-green-border);
  color: var(--alert-green-text);
}

/* Where to Post Section */
.destinations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.destination-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px 16px;
  gap: 12px;
}

.dest-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dest-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.dest-rule-note {
  font-size: 12px;
  color: var(--secondary);
}

.dest-tags {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.tag-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--secondary);
}

.tag-badge.teal {
  background: var(--pill-bg);
  color: var(--teal);
}

.info-banner {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--teal);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: var(--secondary);
  margin-top: 12px;
}

.info-banner.warning {
  border-left-color: #e53e3e;
}

/* Log Section */
.log-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.log-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--surface-border);
}

table.log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--white);
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

/* Weekend Banner & Quick Selection */
.weekend-banner {
  background: rgba(0, 255, 209, 0.04);
  border: 1px solid var(--pill-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.weekend-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.weekend-riders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .weekend-riders-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.weekend-rider-card {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.weekend-rider-card:hover,
.weekend-rider-card.active {
  border-color: var(--teal);
  background: rgba(0, 255, 209, 0.08);
}

.weekend-rider-card .name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weekend-rider-card .rider-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
}

.weekend-rider-card .rider-circuit {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
}

.weekend-rider-card .rider-details {
  font-size: 11px;
  color: var(--secondary);
}
