/* ==========================================================================
   ND Document Studio - Modern 2026 Glassmorphism CSS Design System
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  /* Color Palette */
  --bg-app: #080c14;
  --bg-panel: rgba(17, 25, 40, 0.65);
  --bg-panel-hover: rgba(22, 32, 51, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(255, 255, 255, 0.18);
  --border-neon: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-hover: #4f46e5;
  --color-accent: #06b6d4; /* Cyan */
  --color-accent-hover: #0891b2;
  --color-success: #10b981; /* Emerald */
  --color-danger: #ef4444; /* Rose */
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  --grad-dark: linear-gradient(180deg, #111827, #030712);
  --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  
  /* Effects */
  --blur-glass: blur(16px);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --radius-bento: 18px;
  --radius-inner: 10px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Ambient Background Glows */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
  mix-blend-mode: screen;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  top: -10%;
  left: -10%;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
}

.bg-glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
  top: 40%;
  left: 35%;
}

/* Layout Framework */
.app-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 20px;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Bento Navbar */
.bento-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--bg-panel);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-bento);
  box-shadow: var(--shadow-premium);
  z-index: 10;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--color-accent);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

#active-document-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  gap: 10px;
}

/* Workspace Bento Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 300px 380px 1fr;
  gap: 20px;
  flex-grow: 1;
  min-height: calc(100vh - 122px);
}

/* Responsive workspace grid for smaller screens */
@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto auto;
  }
  .preview-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .preview-panel {
    grid-column: 1;
    grid-row: 1;
  }
  .editor-panel {
    grid-row: 2;
  }
  .templates-sidebar {
    grid-row: 3;
  }
}

/* Bento Panel Styles */
.bento-panel {
  background: var(--bg-panel);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-bento);
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.bento-panel:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-glass-active);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.panel-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

.panel-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Bento Panel 1: Templates Sidebar */
.templates-sidebar {
  padding-bottom: 20px;
}

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  overflow-y: auto;
  max-height: 400px;
}

.template-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.template-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
  transform: translateX(4px);
}

.template-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.05));
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.template-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.template-card:hover .template-icon-wrap,
.template-card.active .template-icon-wrap {
  background: var(--color-primary);
  color: #fff;
}

.template-details h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.template-details p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.saved-drafts-section {
  border-top: 1px solid var(--border-glass);
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.saved-drafts-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.drafts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex-grow: 1;
}

.no-drafts {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-inner);
}

.draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.draft-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.draft-info {
  display: flex;
  flex-direction: column;
}

.draft-name {
  font-weight: 500;
  color: var(--text-primary);
}

.draft-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.draft-actions {
  display: flex;
  gap: 6px;
}

.draft-btn-delete {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.draft-btn-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
}

/* Bento Panel 2: Editor Configurator */
.editor-panel {
  display: flex;
  flex-direction: column;
}

.editor-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.1);
}

.tab-btn {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.04);
}

.editor-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.select-prompt {
  text-align: center;
  padding: 40px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-inner);
}

/* Form Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="date"],
textarea,
select {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

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

/* Image Upload Widget */
.image-upload-box {
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-inner);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.image-upload-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-accent);
}

.upload-icon {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.image-upload-box:hover .upload-icon {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.image-upload-box span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.image-upload-box p {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.upload-preview-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
}

.upload-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}

.upload-meta {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.upload-filename {
  font-size: 0.72rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-image {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-remove-image:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Color Picker & Fonts Widget */
.color-picker-wrapper {
  display: flex;
  gap: 8px;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  background: transparent;
}

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

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
}

.hex-text-input {
  flex-grow: 1;
  text-transform: uppercase;
}

.font-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.font-btn {
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-inner);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.font-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Bento Panel 3: Live Preview Panel */
.preview-panel {
  display: flex;
  flex-direction: column;
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Card flipping switch */
.flip-toggle-wrapper {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2px;
}

.flip-btn {
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.flip-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2px 10px;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

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

#zoom-value {
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  color: var(--text-secondary);
}

/* Canvas Viewport */
.preview-workspace {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  overflow: auto;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
  position: relative;
}

.preview-canvas-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.document-canvas {
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Perspective wrapper for 3D flip card effect */
.perspective-container {
  perspective: 1200px;
}

/* Canvas Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  max-width: 360px;
  color: var(--text-muted);
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Export Bar */
.export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.export-bar.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.export-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.export-icon {
  width: 24px;
  height: 24px;
}

.export-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.export-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.export-buttons {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  outline: none;
}

.btn-icon-text {
  gap: 8px;
}

.btn-icon-text i {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45), 0 0 10px rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass-active);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Helpers */
.hidden {
  display: none !important;
}

.text-accent {
  color: var(--color-accent);
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.animate-pulse {
  animation: pulse 2s infinite ease-in-out;
}


/* ==========================================================================
   DOCUMENT TEMPLATE RENDERING STYLES
   ========================================================================== */

/* Template 1: Employee ID Card */
.id-card-render {
  width: 320px;
  height: 480px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

/* ID Card Front Side Styling */
.id-card-front {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(9, 12, 22, 0.98) 100%);
  position: relative;
}

/* Decorative abstract lines for ID card background */
.id-card-front::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, var(--id-primary, #6366f1) 0%, rgba(6, 182, 212, 0.1) 100%);
  clip-path: ellipse(65% 55% at 50% 0%);
  z-index: 1;
}

.id-card-header {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  margin-bottom: 10px;
}

.id-card-logo-placeholder {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.id-card-subheading {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--id-accent, #06b6d4);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.id-card-photo-wrap {
  position: relative;
  z-index: 2;
  margin: 15px 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--id-primary, #6366f1), var(--id-accent, #06b6d4));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.25);
}

.id-card-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: #1e293b;
  border: 3px solid #0f172a;
}

.id-card-info {
  text-align: center;
  z-index: 2;
  width: 100%;
}

.id-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.id-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--id-accent, #06b6d4);
  letter-spacing: 0.08em;
  margin-bottom: 15px;
}

.id-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-inner);
  padding: 10px;
  text-align: left;
  margin-bottom: 12px;
}

.id-meta-item {
  display: flex;
  flex-direction: column;
}

.id-meta-label {
  font-size: 0.55rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.id-meta-value {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e2e8f0;
}

.id-card-barcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 2;
  margin-top: auto;
  width: 100%;
}

.id-card-barcode-graphic {
  height: 28px;
  width: 140px;
  background: repeating-linear-gradient(
    90deg,
    #e2e8f0,
    #e2e8f0 2px,
    transparent 2px,
    transparent 6px,
    #e2e8f0 6px,
    #e2e8f0 9px,
    transparent 9px,
    transparent 11px,
    #e2e8f0 11px,
    #e2e8f0 12px,
    transparent 12px,
    transparent 16px
  );
  opacity: 0.85;
}

.id-card-barcode-text {
  font-family: monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  color: #64748b;
}

/* ID Card Back Side Styling */
.id-card-back {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(9, 12, 22, 0.98) 0%, rgba(15, 23, 42, 0.92) 100%);
  position: relative;
  text-align: center;
}

.id-card-back::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(315deg, var(--id-primary, #6366f1) 0%, rgba(6, 182, 212, 0.1) 100%);
  clip-path: ellipse(65% 55% at 50% 100%);
  z-index: 1;
}

.id-card-back-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.id-card-back-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-card-rules-list {
  text-align: left;
  list-style: none;
  font-size: 0.62rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.id-card-rules-list li {
  position: relative;
  padding-left: 10px;
}

.id-card-rules-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--id-accent, #06b6d4);
  font-weight: bold;
}

.id-card-contact-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-inner);
  padding: 10px;
  font-size: 0.6rem;
  color: #64748b;
  text-align: left;
  line-height: 1.4;
  margin-bottom: 20px;
}

.id-card-contact-box strong {
  color: #cbd5e1;
}

.id-card-signature-wrap {
  margin-top: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.id-card-signature-line {
  width: 120px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
}

.id-card-signature-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.id-card-signature-graphic {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: -4px;
}


/* Template 2: Press Release */
.press-release-render {
  width: 600px;
  min-height: 800px;
  background-color: #ffffff;
  color: #1e293b;
  padding: 50px 60px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  position: relative;
}

.press-header {
  border-bottom: 3px double #cbd5e1;
  padding-bottom: 18px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.press-brand-info {
  display: flex;
  flex-direction: column;
}

.press-logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--press-primary, #1e3a8a);
}

.press-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

.press-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--press-accent, #64748b);
  border: 1px solid var(--press-accent, #e2e8f0);
  padding: 6px 12px;
  border-radius: 4px;
}

.press-meta-info {
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}

.press-headline {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.press-subheadline {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  color: #475569;
  margin-bottom: 24px;
  font-style: italic;
}

.press-body-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 30px;
  white-space: pre-line;
}

.press-body-text::first-letter {
  font-size: 1.8rem;
  font-weight: 700;
  float: left;
  margin-top: 4px;
  margin-right: 6px;
  line-height: 1;
  color: var(--press-primary, #1e3a8a);
}

.press-boilerplate {
  background-color: #f8fafc;
  border-left: 3px solid var(--press-primary, #1e3a8a);
  padding: 16px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #475569;
  margin-top: auto;
  border-radius: 0 6px 6px 0;
}

.press-boilerplate h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.press-contacts {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 0.75rem;
  color: #64748b;
}

.press-contacts h5 {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.press-legal-footer {
  margin-top: 14px;
  padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Template 3: Business/Event Poster */
.poster-render {
  width: 450px;
  height: 630px;
  position: relative;
  background-color: #000;
  color: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.poster-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  z-index: 1;
}

.poster-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.95) 100%);
  z-index: 2;
}

.poster-content {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 30px;
}

.poster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 10px;
}

.poster-organizer {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--poster-accent, #06b6d4);
}

.poster-tagline {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.poster-middle {
  margin-top: auto;
  margin-bottom: 24px;
}

.poster-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 30%, var(--poster-primary, #6366f1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.poster-description {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cbd5e1;
  opacity: 0.9;
}

.poster-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.poster-details-grid {
  display: flex;
  gap: 20px;
}

.poster-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poster-detail-icon {
  color: var(--poster-accent, #06b6d4);
  opacity: 0.8;
}

.poster-detail-text {
  display: flex;
  flex-direction: column;
}

.poster-detail-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.poster-detail-lbl {
  font-size: 0.55rem;
  color: #64748b;
  text-transform: uppercase;
}

.poster-cta-btn {
  background: var(--poster-accent, #06b6d4);
  color: #000;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 8px 16px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
}


/* Template 4: Marketing Flyer */
.flyer-render {
  width: 500px;
  height: 680px;
  background-color: #ffffff;
  color: #1e293b;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flyer-accent-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--flyer-primary, #6366f1) 0%, var(--flyer-accent, #06b6d4) 100%);
  width: 100%;
}

.flyer-body {
  padding: 36px 36px 24px 36px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.flyer-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--flyer-primary, #6366f1);
  letter-spacing: -0.01em;
}

.flyer-contact-phone {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.flyer-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: center;
}

.flyer-hero-text h2 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 10px;
}

.flyer-hero-text h2 span {
  color: var(--flyer-primary, #6366f1);
}

.flyer-hero-text p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #475569;
}

.flyer-hero-image-wrap {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.flyer-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flyer-features-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.flyer-features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  list-style: none;
  margin-bottom: auto;
}

.flyer-feature-item {
  display: flex;
  gap: 8px;
}

.flyer-feature-icon {
  color: var(--flyer-accent, #06b6d4);
  flex-shrink: 0;
  margin-top: 2px;
}

.flyer-feature-info h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.flyer-feature-info p {
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
}

.flyer-footer {
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flyer-footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flyer-footer-website {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--flyer-primary, #6366f1);
}

.flyer-footer-address {
  font-size: 0.68rem;
  color: #94a3b8;
}

.flyer-footer-reg {
  font-size: 0.6rem;
  color: #64748b;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.flyer-badge {
  background: linear-gradient(135deg, var(--flyer-primary, #6366f1), var(--flyer-accent, #06b6d4));
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 8px 16px;
  border-radius: 30px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}


/* Template 5: Business Card */
.business-card-render {
  width: 440px;
  height: 250px;
  border-radius: 8px;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.biz-card-front {
  width: 100%;
  height: 100%;
  padding: 24px 28px;
  background: linear-gradient(135deg, #111827 0%, #030712 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.biz-card-front::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  height: 100%;
  background: linear-gradient(135deg, transparent 40%, rgba(99, 102, 241, 0.08) 100%);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
}

.biz-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.biz-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--biz-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
}

.biz-logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.biz-contact-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.biz-person {
  display: flex;
  flex-direction: column;
}

.biz-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.biz-title {
  font-size: 0.68rem;
  color: var(--biz-accent, #06b6d4);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.biz-contact-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.62rem;
  color: #94a3b8;
  text-align: right;
}

.biz-contact-item {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.biz-contact-icon {
  color: var(--biz-accent, #06b6d4);
  width: 10px;
  height: 10px;
}

/* Print Styling Configuration */
@media print {
  body * {
    visibility: hidden;
  }
  .preview-workspace, .preview-workspace * {
    visibility: visible;
  }
  .preview-workspace {
    position: absolute;
    left: 0;
    top: 0;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  .preview-canvas-wrapper {
    transform: none !important;
    display: block !important;
  }
  .document-canvas {
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto;
  }
}

/* Cloud Sync UI Components */
.saved-drafts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.saved-drafts-header h3 {
  margin-bottom: 0 !important;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sync-status.online {
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
}

.sync-status.offline {
  color: var(--text-muted);
  border-color: var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

.sync-status i {
  width: 10px;
  height: 10px;
}

.draft-sync-icon {
  margin-right: 6px;
  opacity: 0.6;
}

.draft-sync-icon.text-accent {
  opacity: 1;
}

/* Custom Modal & Toast Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal {
  background: linear-gradient(135deg, rgba(17, 25, 40, 0.85), rgba(10, 15, 30, 0.95));
  border: 1px solid var(--border-glass-active);
  box-shadow: var(--shadow-premium), 0 0 30px rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-bento);
  width: 90%;
  max-width: 440px;
  padding: 24px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-overlay:not(.hidden) .custom-modal:not(.hidden) {
  transform: scale(1) translateY(0);
}

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

.modal-icon {
  width: 24px;
  height: 24px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #b91c1c);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, rgba(17, 25, 40, 0.9), rgba(10, 15, 30, 0.98));
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-premium);
  border-radius: var(--radius-inner);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  pointer-events: auto;
  min-width: 250px;
  max-width: 380px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast-success i {
  color: var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-danger);
}

.toast-error i {
  color: var(--color-danger);
}

.toast-info {
  border-left: 4px solid var(--color-accent);
}

.toast-info i {
  color: var(--color-accent);
}

/* ===== Site Footer ===== */
.site-footer {
  width: 100%;
  padding: 12px 20px;
  background: var(--bg-panel);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-top: 1px solid var(--border-glass);
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
}

.site-footer-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.site-footer-divider {
  color: var(--border-glass-active);
  font-size: 0.78rem;
  user-select: none;
}

.site-footer-detail {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.site-footer-detail strong {
  color: var(--text-secondary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .site-footer-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  .site-footer-divider {
    display: none;
  }
}
