/* ==========================================================================
   POLAROID PRINT — MODERN DESIGN SYSTEM & PREMIUM UI
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-main: #0b0f17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-card: rgba(26, 34, 52, 0.7);
  --bg-card-hover: rgba(35, 45, 68, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.35);

  --accent-coral: #ff5e57;
  --accent-coral-hover: #e04b45;
  --accent-coral-glow: rgba(255, 94, 87, 0.35);

  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;

  /* Typography */
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Shadows & Glassmorphism */
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.09);
  --glass-blur: blur(16px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-sheet: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  background-color: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Header */
.app-header {
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 50;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}

.brand-title span {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

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

/* Mode Switcher in Header */
.mode-toggle-group {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 2px 10px var(--accent-primary-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-primary-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

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

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-micro {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-micro:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface-elevated);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  animation: fadeInDown 0.15s ease-out forwards;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
  width: 100%;
}

.dropdown-item strong {
  font-size: 0.8125rem;
}

.dropdown-item small {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

.dropdown-item:hover small {
  color: var(--text-secondary);
}

/* App Layout: 2 Columns */
.app-layout {
  display: grid;
  grid-template-columns: 1fr 410px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Section: Canvas Stage */
.sheet-section {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 30%, #151d2f 0%, #0b0f17 80%);
  border-right: var(--glass-border);
  position: relative;
  overflow: hidden;
}

.sheet-toolbar {
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(17, 24, 39, 0.4);
  z-index: 10;
}

.toolbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.pill-badge {
  font-weight: 700;
  color: #fff;
}

.pill-divider {
  color: var(--text-muted);
}

.sheet-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn.danger-hover:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Canvas Stage */
.canvas-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 30px;
  overflow: auto;
  user-select: none;
}

/* The 10x15 Sheet Wrapper */
.sheet-wrapper {
  position: relative;
  display: inline-block;
  box-shadow: var(--shadow-sheet);
  border-radius: 4px;
  transition: transform 0.2s ease;
  background: #ffffff;
  overflow: hidden;
}

/* View Canvas: sharp rendering */
#view-canvas {
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Dynamic Overlays Container */
.overlays-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Interactive Drag Overlays for direct manipulation */
.card-overlay {
  position: absolute;
  cursor: grab;
  z-index: 5;
  pointer-events: auto;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border-radius: 2px;
}

.card-overlay:active {
  cursor: grabbing;
}

.card-overlay.active {
  box-shadow: inset 0 0 0 2px var(--accent-primary);
}

.card-selection-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.card-overlay:hover .card-selection-tag,
.card-overlay.active .card-selection-tag {
  opacity: 1;
  transform: translateY(0);
}

.card-drag-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-overlay:hover .card-drag-hint {
  opacity: 1;
}

.card-overlay.dragging .card-drag-hint {
  opacity: 0;
}

/* Cut Indicator above the center line */
.cut-indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  pointer-events: none;
}

.sheet-cut-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-left: 1.5px dashed rgba(244, 63, 94, 0.7);
  pointer-events: none;
  z-index: 6;
}

.cut-line-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(244, 63, 94, 0.9);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.4);
}

/* Print Instruction Banner */
.print-instruction-banner {
  padding: 12px 20px;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.instruction-icon {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.instruction-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.instruction-text strong {
  color: #fff;
}

.instruction-text em {
  color: #e2e8f0;
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
}

/* Right Section: Control Sidebar */
.control-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: var(--glass-border);
  height: 100%;
  overflow: hidden;
}

/* Tabs Header */
.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 8px 0;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.tab-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.tab-indicator.dot-left {
  background: #38bdf8;
}

.tab-indicator.dot-right {
  background: #f472b6;
}

.tab-btn#tab-sheet-settings {
  flex: 0 0 46px;
}

/* Tab Content Wrapper */
.tab-content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Scrollbar styling */
.tab-content-wrapper::-webkit-scrollbar {
  width: 6px;
}

.tab-content-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.tab-content-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Control Cards */
.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-section-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-section-title svg {
  color: var(--accent-primary);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(0.99);
}

.upload-icon-bubble {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

.dropzone-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.upload-helpers {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* Control Rows */
.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.value-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Sliders with Buttons */
.slider-with-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

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

.actions-row {
  display: flex;
  gap: 8px;
}

.actions-row .btn {
  flex: 1;
}

/* Filter Chips */
.filter-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.filter-chip {
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border-color: var(--accent-primary);
}

/* Handwritten Caption section */
.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 90px 8px 12px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-with-action input:focus {
  border-color: var(--border-focus);
}

.btn-inside-input {
  position: absolute;
  right: 6px;
  padding: 4px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-inside-input:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.control-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.sub-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.select-field {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.775rem;
  outline: none;
  cursor: pointer;
}

.select-field:focus {
  border-color: var(--border-focus);
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary-glow);
}

/* Segmented Control (Paper format) */
.segmented-control {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.segmented-btn {
  flex: 1;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segmented-btn:hover {
  color: #fff;
}

.segmented-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-primary-glow);
}

/* True Size Info Box */
.truesize-info-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.775rem;
  font-weight: 600;
  color: #fff;
}

.badge-mini {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.truesize-info-box p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.truesize-info-box strong {
  color: #fff;
}

/* Sheet & Frame Settings Tab */
.frame-themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.frame-theme-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.frame-theme-card:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.frame-theme-card.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #fff;
}

.frame-preview-box {
  width: 22px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.radio-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

.radio-card.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}

.radio-card-content strong {
  display: block;
  font-size: 0.8125rem;
  color: #fff;
}

.radio-card-content small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   PRINT SPECIFICATION FOR 10×15 CM PHOTO PAPER
   ========================================================================== */
@media print {
  /* Page size standard photo 10x15 cm in landscape (150mm x 100mm) */
  @page {
    size: 150mm 100mm;
    margin: 0mm;
  }

  body, html {
    margin: 0 !important;
    padding: 0 !important;
    width: 150mm !important;
    height: 100mm !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  .app-header,
  .sheet-toolbar,
  .control-sidebar,
  .print-instruction-banner,
  .cut-indicator,
  .card-overlay,
  .toast,
  .dropdown-menu {
    display: none !important;
  }

  .app-layout,
  .sheet-section,
  .canvas-stage {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 150mm !important;
    height: 100mm !important;
    background: none !important;
    border: none !important;
    overflow: hidden !important;
  }

  .sheet-wrapper {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 150mm !important;
    height: 100mm !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  #view-canvas {
    width: 150mm !important;
    height: 100mm !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
  }
}

/* Responsive Styles */
@media (max-width: 960px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .sheet-section {
    min-height: 400px;
  }

  .control-sidebar {
    height: auto;
    max-height: 50vh;
    border-top: var(--glass-border);
    border-left: none;
  }
}
