/* ==========================================================================
   Passport Photo Maker - Canvas Editor & Print Sheet Styles
   ========================================================================== */

.photo-editor-wrapper {
    width: 100%;
    margin-bottom: 24px;
}

/* Upload Dropzone */
.upload-container {
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}
.upload-container:hover, .upload-container.dragover {
    border-color: #2563eb;
    background: #f0f7ff;
}
.upload-dropzone {
    text-align: center;
    padding: 48px 24px;
}
.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.upload-icon {
    font-size: 42px;
}
.upload-title {
    font-size: 24px;
    margin: 0 0 8px;
    color: #0f172a;
}
.upload-subtitle {
    font-size: 15px;
    margin: 0 0 24px;
}
.upload-btn-wrapper {
    margin-bottom: 20px;
}
.upload-trigger-btn {
    padding: 0 32px;
}
.dot-sep {
    margin: 0 8px;
    color: #cbd5e1;
}

/* Editor Workspace Layout */
.editor-container {
    width: 100%;
}
.editor-canvas-card, .editor-controls-card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    background: #ffffff;
    overflow: hidden;
}

/* Top Bar Above Canvas */
.canvas-top-bar {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

/* Canvas Viewport */
.canvas-viewport {
    position: relative;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    max-height: 600px;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    cursor: grab;
}
.canvas-viewport:active {
    cursor: grabbing;
}
#photo-canvas {
    display: block;
    max-width: 90%;
    max-height: 440px;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    background: #ffffff;
}

/* Face Positioning Guide Overlay (ICAO standard) */
.face-guide-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
    display: block;
    z-index: 10;
    transition: opacity 0.2s;
}
.guide-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(56, 189, 248, 0.85);
    text-align: right;
    padding-right: 6px;
}
.guide-line span {
    background: rgba(15, 23, 42, 0.75);
    color: #38bdf8;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    position: relative;
    top: -9px;
}
.guide-top-head { top: 12%; }
.guide-eye-level { top: 42%; border-top-color: rgba(74, 222, 128, 0.85); }
.guide-eye-level span { color: #4ade80; }
.guide-chin-level { bottom: 18%; border-top-color: rgba(251, 191, 36, 0.85); }
.guide-chin-level span { color: #fbbf24; }

.guide-oval {
    position: absolute;
    top: 12%;
    left: 15%;
    right: 15%;
    bottom: 18%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50% 50% 45% 45%;
}

.canvas-hint {
    position: absolute;
    bottom: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5e1;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 12;
}

/* Toolbar under Canvas */
.canvas-bottom-toolbar {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

/* Right Controls Column */
.controls-tab-header {
    border-bottom: 1px solid var(--border-color);
}
.controls-tab-header .tabs {
    height: 44px;
    background: #f8fafc;
}
.controls-tab-header .tabs .tab a {
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
    text-transform: none;
    line-height: 44px;
    height: 44px;
    padding: 0 12px;
}
.controls-tab-header .tabs .tab a.active {
    color: var(--primary-color);
    background: #ffffff;
}
.controls-tab-header .tabs .indicator {
    background-color: var(--primary-color);
    height: 3px;
}
.tab-pane {
    padding: 20px 24px;
    display: none;
}
.tab-pane.active {
    display: block;
}
.control-section-title {
    font-size: 15px;
    color: #0f172a;
    margin: 0 0 12px;
}

/* Color Swatches */
.bg-color-swatches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.bg-swatch-btn {
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
    font-weight: 600;
}
.bg-swatch-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.bg-swatch-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.swatch-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}
.color-picker-input {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

/* Target KB Chips */
.target-kb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kb-chip-btn, .comp-chip-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: #334155;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.kb-chip-btn:hover, .comp-chip-btn:hover {
    background: #e2e8f0;
}
.kb-chip-btn.active, .comp-chip-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Export Summary Box */
.export-summary-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #edf2f7;
}
.summary-item:last-child {
    border-bottom: none;
}
.summary-label {
    color: #64748b;
}
.summary-value {
    font-weight: 600;
    color: #0f172a;
}

/* Sliders */
.custom-slider {
    width: 100%;
    margin: 6px 0;
    accent-color: #2563eb;
}

/* Aspect Ratio Buttons */
.aspect-ratio-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.crop-ratio-btn {
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    height: 36px;
    line-height: 36px;
    color: #334155;
    text-align: center;
}
.crop-ratio-btn.active {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
}

/* Print Sheet Modal & Preview */
.print-sheet-modal {
    max-width: 960px !important;
    width: 95% !important;
    max-height: 90% !important;
    border-radius: 16px !important;
}
.print-preview-wrapper {
    background: #334155;
    border-radius: 8px;
    padding: 16px;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
#print-sheet-canvas {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 100%;
    max-height: 520px;
    height: auto;
}

/* Comparison Preview Boxes */
.preview-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.preview-badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.preview-img-wrap {
    height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}
.preview-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.preview-stat-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ==========================================================================
   Strict Print Media Styling (100% Actual Size Physical Dimensions)
   ========================================================================== */
@media print {
    @page {
        margin: 0;
        size: auto;
    }
    body, html {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    header, nav, .privacy-topbar, footer, .hero-section, .section-padding,
    .upload-container, .editor-controls-col, .canvas-top-bar, .canvas-bottom-toolbar,
    .print-options-col, .breadcrumb-nav, .modal-close, #search-modal {
        display: none !important;
    }
    #print-sheet-modal {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    .print-preview-wrapper {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    #print-sheet-canvas {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border: none !important;
    }
}
