/* Biz-Cards Designer - CSS */

:root {
    /* Color Palette - Warm professional tones */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --surface: #1f2544;
    --surface-hover: #2a3158;
    --border: #3a4168;
    --border-light: #4a5278;
    
    --text-primary: #e8e8e8;
    --text-secondary: #a0a8c0;
    --text-muted: #6b7280;
    
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Card dimensions at 96 DPI */
    --card-width: 321px;  /* 85mm */
    --card-height: 208px; /* 55mm */
    --px-per-mm: 3.7795275591;
}

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

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-left h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--accent);
    margin: 0;
}

.design-name-container input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 200px;
}

.design-name-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.header-center {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.zoom-controls button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-controls button:hover {
    background: var(--surface-hover);
}

.zoom-controls span {
    min-width: 50px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Buttons */
button {
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

button:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--border-light);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

button.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

button.danger:hover:not(:disabled) {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Toolbar */
.toolbar-left {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: var(--spacing-md);
}

.tool-section {
    margin-bottom: var(--spacing-lg);
}

.tool-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.tool-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: var(--spacing-xs);
}

/* Custom Font Select */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.custom-select-trigger:hover:not(:disabled) {
    border-color: var(--border-light);
}

.custom-select-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-select-arrow {
    margin-left: var(--spacing-sm);
    color: var(--text-muted);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-select-wrapper.open .custom-select-dropdown {
    display: block;
}

.custom-select-group-label {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.custom-select-option {
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.custom-select-option:hover,
.custom-select-option.highlighted {
    background: var(--surface-hover);
}

.custom-select-option.selected {
    background: var(--accent);
    color: white;
}

.font-preview-large {
    padding: var(--spacing-md);
    background: var(--card-bg);
    color: #000;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.4rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    border: 2px solid var(--border);
}

/* Font filter */
.font-filter-wrapper {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.font-filter-input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.font-filter-input:focus {
    outline: none;
    border-color: var(--accent);
}

.custom-select-option.hidden {
    display: none;
}

.custom-select-group.hidden {
    display: none;
}

/* Size Controls */
.size-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.size-control input {
    width: 60px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: center;
}

.size-control span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.size-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.size-preset {
    width: 32px;
    height: 28px;
    padding: 0;
    font-size: 0.8rem;
    justify-content: center;
}

/* Style Buttons */
.style-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.style-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 700;
    justify-content: center;
}

.style-btn.italic {
    font-style: italic;
    font-family: serif;
}

.style-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Color Controls */
.color-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.color-control input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.color-control input[type="text"] {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.color-preset {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.color-preset:hover {
    transform: scale(1.1);
}

/* Align Buttons */
.align-buttons, .position-buttons {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.align-btn, .pos-btn {
    flex: 1;
    height: 32px;
    padding: 0;
    font-size: 1.1rem;
    justify-content: center;
}

.align-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Position Inputs */
.position-inputs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.position-inputs label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.position-inputs input {
    width: 55px;
    padding: var(--spacing-xs);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.85rem;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
    background-size: 20px 20px;
    overflow: hidden;
    position: relative;
}

/* Ruler Toggle */
.ruler-toggle {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 100;
}

.ruler-toggle button {
    font-size: 0.8rem;
}

.ruler-toggle button.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Rulers */
.ruler {
    background: var(--bg-secondary);
    position: relative;
    display: none; /* Hidden by default */
}

.rulers-visible .ruler {
    display: block;
}

.ruler-top {
    height: 20px;
    border-bottom: 1px solid var(--border);
    margin-left: 20px; /* Space for corner */
    cursor: s-resize; /* Indicate drag down */
}

.ruler-left {
    width: 20px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    cursor: e-resize; /* Indicate drag right */
}

.ruler-track {
    position: absolute;
    overflow: visible;
}

.ruler-top .ruler-track {
    height: 100%;
    left: 0;
    right: 0;
    top: 0;
}

.ruler-left .ruler-track {
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
}

/* Ruler tick marks */
.ruler-tick {
    position: absolute;
    background: var(--text-muted);
}

.ruler-top .ruler-tick {
    width: 1px;
    bottom: 0;
}

.ruler-left .ruler-tick {
    height: 1px;
    right: 0;
}

.ruler-tick.major {
    background: var(--text-primary);
}

.ruler-top .ruler-tick.mm { height: 4px; }
.ruler-top .ruler-tick.half-cm { height: 8px; }
.ruler-top .ruler-tick.cm { height: 14px; }

.ruler-left .ruler-tick.mm { width: 4px; }
.ruler-left .ruler-tick.half-cm { width: 8px; }
.ruler-left .ruler-tick.cm { width: 14px; }

/* Ruler numbers */
.ruler-number {
    position: absolute;
    font-size: 11px;
    color: var(--text-primary);
    font-family: monospace;
    font-weight: 600;
    text-shadow: 0 0 2px var(--bg-secondary);
}

.ruler-top .ruler-number {
    top: 2px;
    transform: translateX(2px);
}

.ruler-left .ruler-number {
    left: 2px;
    transform: translateY(2px);
}

/* Unit toggle */
.ruler-unit-toggle {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 8px;
    color: var(--text-secondary);
    z-index: 10;
    padding: 0;
}

.rulers-visible .ruler-unit-toggle {
    display: flex;
}

.ruler-unit-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.canvas-with-ruler {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    overflow: auto;
    position: relative;
}

.card-canvas {
    width: var(--card-width);
    height: var(--card-height);
    background: var(--card-bg);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    transform-origin: center center;
    transition: transform var(--transition-normal);
    overflow: visible; /* Allow text boxes in pasteboard */
}

.canvas-info {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Snap Guides (temporary, for centering feedback) */
.snap-guide {
    position: absolute;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity var(--transition-fast);
}

.snap-guide.guide-h {
    left: -100%;
    right: -100%;
    height: 1px;
}

.snap-guide.guide-v {
    top: -100%;
    bottom: -100%;
    width: 1px;
}

.snap-guide.visible {
    opacity: 0.8;
}

/* User Guides (draggable, persistent) */
.guides-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 50;
}

.user-guide {
    position: absolute;
    background: #00d4ff; /* Cyan like InDesign */
    pointer-events: auto;
    cursor: pointer;
    z-index: 50;
}

.user-guide.horizontal {
    left: -500px;
    right: -500px;
    height: 1px;
    cursor: ns-resize;
    /* Expand click area */
    padding: 3px 0;
    margin-top: -3px;
    background-clip: content-box;
}

.user-guide.vertical {
    top: -500px;
    bottom: -500px;
    width: 1px;
    cursor: ew-resize;
    /* Expand click area */
    padding: 0 3px;
    margin-left: -3px;
    background-clip: content-box;
}

.user-guide:hover,
.user-guide.selected {
    background: #00ffff;
    box-shadow: 0 0 4px #00ffff;
}

.user-guide.horizontal.selected {
    height: 2px;
}

.user-guide.vertical.selected {
    width: 2px;
}

/* Guide drag preview */
.guide-drag-preview {
    position: fixed;
    background: #00d4ff;
    opacity: 0.7;
    pointer-events: none;
    z-index: 1000;
}

.guide-drag-preview.horizontal {
    left: 0;
    right: 0;
    height: 1px;
}

.guide-drag-preview.vertical {
    top: 0;
    bottom: 0;
    width: 1px;
}

/* Text Box */
.text-box {
    position: absolute;
    min-width: 20px;
    min-height: 16px;
    cursor: move;
    border: 1px dashed transparent;
    transition: border-color var(--transition-fast);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5); /* 50% white - readable in pasteboard */
}

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

.text-box.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.text-box.editing {
    cursor: text;
}

.text-box.editing .text-box-content {
    cursor: text;
    user-select: text;
}

.text-box.selected:not(.editing) .text-box-content {
    cursor: pointer;
}

.text-box-content {
    width: 100%;
    height: 100%;
    outline: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-box-content:empty::before {
    content: 'Click to edit';
    color: #999;
    pointer-events: none;
}

/* Context Menu */
.textbox-context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    min-width: 150px;
    padding: var(--spacing-xs) 0;
}

.context-menu-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.context-menu-item:hover {
    background: var(--surface-hover);
}

.context-menu-item.danger:hover {
    background: var(--danger);
    color: white;
}

.context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-xs) 0;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border: 1px solid white;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.text-box.selected .resize-handle {
    opacity: 1;
    pointer-events: auto;
}

.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.resize-handle.n { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w { top: 50%; left: -4px; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; }

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-modal-content {
    width: 90vw;
    height: 90vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Preview Controls */
.preview-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.margin-controls {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.margin-controls label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

#btn-reset-margins {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
}

.margin-controls input {
    width: 60px;
    padding: var(--spacing-xs);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: center;
}

.preview-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Preview Container */
.preview-container {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #3a3a3a;
}

.a4-preview {
    width: 794px; /* A4 at 96 DPI: 210mm */
    height: 1123px; /* A4 at 96 DPI: 297mm */
    background: white;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform-origin: top center;
}

.preview-card {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    background: var(--card-bg);
    overflow: hidden;
    border: 1px solid #eee;
}

.preview-card .text-box {
    border: none !important;
    box-shadow: none !important;
}

/* Load Modal */
#load-modal .modal-content {
    width: 600px;
    max-height: 70vh;
}

.designs-list {
    padding: var(--spacing-md);
    overflow-y: auto;
    flex: 1;
}

.design-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.design-item:hover {
    background: var(--surface-hover);
}

.design-item-info h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.design-item-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.design-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.design-item-actions button {
    padding: var(--spacing-xs) var(--spacing-sm);
}

.no-designs {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: all var(--transition-normal);
}

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

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

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Hide number input spinners - use scroll wheel instead */
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Print Styles */
@media print {
    /* Reset everything - remove ALL constraints */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: white !important;
    }
    
    /* Hide everything except preview */
    .app-header,
    .main-content,
    .toolbar-left,
    .canvas-area,
    .modal-header,
    .preview-controls {
        display: none !important;
    }
    
    /* Reset modal for print - no constraints */
    #preview-modal {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
        backdrop-filter: none !important;
        overflow: visible !important;
    }
    
    #preview-modal .modal-content {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: none !important;
        overflow: visible !important;
    }
    
    .preview-container {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
    }
    
    .a4-preview {
        position: static !important;
        display: block !important;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        overflow: visible !important;
        page-break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .preview-card {
        border: none !important;
    }
    
    .preview-card .text-box {
        border: none !important;
        background: transparent !important;
    }
}

@page {
    size: A4 portrait;
    margin: 0mm;
}


