/* tools/pdf-redactor/style.css */

body {
    padding: 1rem;
}

/* ── Workspace ──────────────────────────────────────────────────────── */
.workspace {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.workspace.visible { display: block; }

/* ── Toolbar ────────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-group { min-width: 200px; }
.zoom-group { border-left: 1px solid var(--border); padding-left: 0.75rem; }
.action-group { margin-left: auto; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    padding: 7px 13px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-nav:not(:disabled):hover { background: var(--bg); }

.btn-icon {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
    font-size: 1rem;
    border-radius: 6px;
}
.btn-icon:not(:disabled):hover { background: var(--bg); }

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover { background: #e2e8f0; }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(0,74,173,0.25);
}

.page-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 90px;
    text-align: center;
}

.zoom-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 42px;
    text-align: center;
}

/* ── Status Bar ─────────────────────────────────────────────────────── */
.status-bar {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    color: #0369a1;
    font-weight: 500;
    min-height: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
}
.status-bar:empty { display: none; }

/* ── Canvas Viewport ────────────────────────────────────────────────── */
.canvas-wrapper {
    overflow: auto;
    max-height: calc(100vh - 280px);
    background: #64748b;
    min-height: 320px;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    min-width: 100%;
    min-height: 200px;
}

#mainCanvas {
    display: block;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    background: white;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* ── Loading Overlay ────────────────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(248,249,252,0.82);
    gap: 0.75rem;
    z-index: 10;
    border-radius: 2px;
}
.loading-overlay.active { display: flex; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loadingText {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    .back-link { position: static; display: inline-block; margin-bottom: 0.75rem; }

    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-group { justify-content: center; }
    .zoom-group { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 0.5rem; }
    .action-group { margin-left: 0; }
    .action-group .btn { flex: 1; justify-content: center; }

    .canvas-wrapper { max-height: 55vh; }
    .how-to { gap: 0.35rem; }
    .step-arrow { display: none; }
}
