/* ==========================================================================
   PASSPORT PRO - Premium Dark Studio CSS
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0b0f19;
    --bg-surface: #111827;
    --card-bg: rgba(17, 24, 39, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-glow: rgba(6, 182, 212, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    
    --btn-primary-bg: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --btn-primary-hover: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
    --btn-secondary-bg: rgba(255, 255, 255, 0.06);
    --btn-secondary-hover: rgba(255, 255, 255, 0.12);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.25);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    height: 60px;
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

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

.logo-icon-glow {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--btn-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.logo-icon {
    width: 22px;
    height: 22px;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-main);
    line-height: 1.1;
}

.logo-text h1 span {
    color: var(--accent-cyan);
    font-weight: 400;
    margin-left: 4px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-engine {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Main Body Layout */
.app-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Side Panels Common */
.side-panel {
    background: var(--bg-surface);
    border-color: var(--card-border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.side-panel::-webkit-scrollbar {
    width: 6px;
}

.side-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Left Control Panel */
.control-panel {
    width: 340px;
    min-width: 320px;
    border-right: 1px solid var(--card-border);
}

/* Right Export Panel */
.export-panel {
    width: 320px;
    min-width: 300px;
    border-left: 1px solid var(--card-border);
}

/* Panel Sections */
.panel-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(16px);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: #0b0f19;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    background: rgba(6, 182, 212, 0.02);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
}

.file-hidden {
    display: none !important;
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.upload-icon-wrapper {
    width: 44px;
    height: 44px;
    margin: 0 auto 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

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

.upload-text-main {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.upload-text-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Control Groups & Labels */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group label svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

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

.select-wrapper select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 9px 32px 9px 12px;
    font-family: inherit;
    font-size: 13px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.select-wrapper select:focus {
    border-color: var(--accent-cyan);
}

.select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Custom Dimensions Row */
.custom-dims-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dim-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dim-field label {
    font-size: 11px;
    color: var(--text-dim);
}

.dim-field input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.dim-field input:focus {
    border-color: var(--accent-cyan);
}

/* Color Palette Selector */
.color-presets-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.color-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
}

.color-preview {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.transparent-pattern {
    background-image: repeating-linear-gradient(45deg, #444 0, #444 3px, #222 0, #222 6px);
}

.color-name {
    font-size: 11px;
    color: var(--text-muted);
}

/* AI Background & Custom Color Picker Styling */
.label-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-bg-toggle-box {
    background: rgba(6, 182, 212, 0.06);
    border: 1px dashed var(--card-border-glow);
    padding: 8px 12px;
    border-radius: var(--radius-md);
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-main);
    user-select: none;
}

.switch-row input {
    display: none;
}

.slider-toggle {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.slider-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s ease;
}

.switch-row input:checked + .slider-toggle {
    background: var(--accent-cyan);
}

.switch-row input:checked + .slider-toggle::before {
    transform: translateX(14px);
}

.switch-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

.custom-color-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.custom-color-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.color-input-element {
    width: 28px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.custom-color-hex {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent-cyan);
    font-weight: 700;
}

.ai-fine-tune-details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

.ai-fine-tune-details summary {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.ai-fine-tune-details summary svg {
    width: 12px;
    height: 12px;
    color: var(--accent-cyan);
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-dim);
}

.slider-control input[type="range"] {
    width: 100%;
    accent-color: var(--accent-cyan);
    height: 4px;
}

/* Toggle Switches */
.toggle-control-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

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

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-label svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.toggle-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider.round {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 20px;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-cyan);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Segmented Control Buttons */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    gap: 4px;
}

.segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-btn svg {
    width: 14px;
    height: 14px;
}

.segment-btn.active {
    background: var(--accent-cyan);
    color: #0b0f19;
}

/* Tool Buttons Grid */
.tool-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
}

/* Range Field Sliders */
.range-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.range-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.range-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range-header svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.range-val {
    color: var(--accent-cyan);
    font-weight: 600;
}

input[type=range] {
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: transform 0.1s ease;
}

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

/* Accordion */
.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
}

.accordion-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.accordion-header svg {
    width: 14px;
    height: 14px;
}

.accordion-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: #fff;
    box-shadow: var(--shadow-subtle);
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

/* Center Workspace Area */
.workspace-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

/* Workspace Tabs Bar */
.workspace-tabs-bar {
    height: 48px;
    background: rgba(17, 24, 39, 0.6);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    padding: 0 16px;
    gap: 8px;
    align-items: center;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

/* Viewport Containers */
.tab-viewport {
    flex: 1;
    display: none;
    position: relative;
    overflow: hidden;
}

.tab-viewport.active {
    display: flex;
}

/* Tab 1: Cropper Viewport */
#viewport-cropper {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cropper-container-wrapper {
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 650px;
    background: #000;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Biometric SVG Guide Overlay */
.biometric-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    display: none;
}

.biometric-overlay-layer.active {
    display: block;
}

.biometric-svg {
    width: 100%;
    height: 100%;
}

.guide-oval-head {
    fill: none;
    stroke: url(#guide-grad);
    stroke-width: 0.8;
    stroke-dasharray: 2 1;
}

.guide-line-eye {
    stroke: var(--accent-cyan);
    stroke-width: 0.6;
    stroke-dasharray: 1 1;
}

.guide-line-chin, .guide-line-top {
    stroke: var(--accent-amber);
    stroke-width: 0.5;
    stroke-dasharray: 1 1;
}

.guide-line-center {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 0.4;
    stroke-dasharray: 2 2;
}

.guide-text {
    fill: var(--accent-cyan);
    font-size: 2.2px;
    font-weight: 700;
    text-anchor: middle;
    letter-spacing: 0.2px;
}

/* Workspace Empty State */
.workspace-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    max-width: 420px;
}

.empty-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.empty-icon-circle svg {
    width: 36px;
    height: 36px;
}

.workspace-empty-state h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.workspace-empty-state p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.empty-btn-group {
    display: flex;
    gap: 12px;
}

/* Floating Toolbar */
.floating-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 30;
    box-shadow: var(--shadow-subtle);
}

.btn-tool {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-tool:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-tool svg {
    width: 18px;
    height: 18px;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

/* Tab 2: Sheet Preview Viewport */
#viewport-print-sheet {
    flex-direction: column;
}

.sheet-preview-scroll-area {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: repeating-linear-gradient(45deg, #090d16 0, #090d16 10px, #0b0f19 0, #0b0f19 20px);
}

.sheet-paper-container {
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
    transform-origin: center center;
    position: relative;
}

#sheet-preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Sheet Controls Bar */
/* Preset Info Badge */
.preset-info-badge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    transition: all 0.2s ease;
}

.preset-info-badge .info-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
    flex-shrink: 0;
    margin-top: 1px;
}

/* Toast Notification Center */
.toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(0);
}

/* Glowing PWA Install Button */
.btn-install-glow {
    background: linear-gradient(135deg, #06b6d4, #3b82f6) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(6, 182, 212, 0.5); }
    50% { box-shadow: 0 0 22px rgba(6, 182, 212, 0.9); }
}

.toast-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-cyan);
}

/* US-Based Website Tagline Badge */
.us-site-tag {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* User Auth Header Widget */
.btn-google-header {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google-header:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-cyan);
}

.inline-g-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid var(--accent-cyan);
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

.user-avatar-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: #0b0f19;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.user-email-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.btn-logout:hover {
    color: #ff4d4f;
}

/* Primary Google Auth Modal Card */
.auth-modal-card {
    max-width: 440px;
    padding: 32px 28px;
    background: #0f172a;
    border: 1px solid var(--card-border-glow);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), var(--shadow-glow);
}

.google-g-icon-wrapper {
    display: flex;
    justify-content: center;
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.us-banner-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.btn-google-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: #1f2937;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-google-signin:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-dim);
    font-size: 11px;
    margin: 16px 0;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}

.auth-divider span {
    padding: 0 10px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 10px 12px 10px 38px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-with-icon input:focus {
    border-color: var(--accent-cyan);
}

.btn-guest-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.btn-guest-link:hover {
    color: var(--accent-cyan);
}

/* Google Account Chooser Styles */
.google-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.google-account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.google-account-card:hover, .google-account-card.active {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--accent-cyan);
}

.account-avatar-bg {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ea4335;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-blue {
    background: #4285f4;
}

.account-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.account-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.account-email {
    font-size: 11px;
    color: var(--text-muted);
}

.account-check-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-cyan);
}

/* Modal System */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--card-border-glow);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

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

.modal-app-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--btn-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.install-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-main);
}

.step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inline-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

/* QR Code & Mobile URL Share Box */
.qr-share-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--card-border-glow);
    padding: 14px;
    border-radius: var(--radius-lg);
}

.qr-code-wrapper {
    width: 90px;
    height: 90px;
    background: #ffffff;
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#pwa-qr-code canvas, #pwa-qr-code img {
    width: 100% !important;
    height: 100% !important;
}

.qr-share-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qr-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-title svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.qr-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.mobile-url-box {
    display: flex;
    gap: 6px;
}

.mobile-url-box input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    font-family: monospace;
    font-size: 11px;
    padding: 6px 10px;
    outline: none;
}

.block { display: block; }
.text-center { text-align: center; }

.sheet-info-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sheet-info-tag svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.zoom-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.btn-tool-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-tool-sm:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.btn-tool-sm svg {
    width: 14px;
    height: 14px;
}

.zoom-level-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    min-width: 36px;
    text-align: center;
}

/* Cards & Analytics */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-primary-card {
    border-color: var(--card-border-glow);
    box-shadow: var(--shadow-glow);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 16px;
    height: 16px;
    color: var(--accent-cyan);
}

.card-desc {
    font-size: 11px;
    color: var(--text-muted);

}

.stat-main-box {
    text-align: center;
    background: rgba(6, 182, 212, 0.08);
    border: 1px dashed rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
}

.stat-number-giant {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--accent-cyan);
    line-height: 1;
}

.stat-label-giant {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.stat-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.text-cyan { color: var(--accent-cyan); }
.text-glow { text-shadow: 0 0 10px rgba(6, 182, 212, 0.5); }

.progress-bar-wrapper {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--btn-primary-bg);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.export-btn-group {
    display: flex;
    gap: 8px;
}

/* Utilities */
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-xs { font-size: 11px; }

.btn-xs {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

/* Mobile Top Banner */
.mobile-top-banner {
    display: none;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border-glow);
    padding: 8px 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
}

.banner-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.banner-btns {
    display: flex;
    gap: 6px;
}

/* Mobile App Download Card */
.mobile-app-download-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(6, 182, 212, 0.08);
    border: 1px dashed var(--card-border-glow);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    width: 100%;
}

.app-box-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-box-title svg {
    width: 14px;
    height: 14px;
    color: var(--accent-cyan);
}

.app-box-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

/* Responsive Mobile Layout */
@media (max-width: 1024px) {
    .app-body {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .side-panel {
        width: 100%;
        min-width: 100%;
    }
    
    .workspace-area {
        min-height: 480px;
    }
}

@media (max-width: 768px) {
    .mobile-top-banner {
        display: flex;
    }
    
    .app-header {
        height: auto;
        padding: 10px 16px;
    }
    
    .logo-subtitle, .badge-engine {
        display: none !important;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .cropper-container-wrapper {
        max-height: 420px;
    }
}
