/* tools/number/number.css */

/* Reuse base styles from watermark */
.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.row-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.full-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.helper-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Format Toggles */
.toggle-group {
    display: flex;
    gap: 4px;
    background: var(--bg-color);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.icon-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
}

.icon-toggle:hover {
    background: #e5e7eb;
}

.icon-toggle.active {
    background: #10B981;
    /* emerald/green category theme */
    color: #fff;
}

.color-picker-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.color-picker-simple label {
    margin: 0;
}

.color-picker-simple input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
}

/* Position 3x3 Grid Matrix */
.position-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    width: 90px;
    height: 90px;
    margin: 0 auto;
    background: #e5e7eb;
    padding: 6px;
    border-radius: 8px;
}

.pos-cell {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-cell:hover {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

.pos-cell.active {
    background: #10B981;
    border-color: #10B981;
}

/* Simulated Live Page Number Overlay */
.number-overlay-container {
    position: absolute;
    /* This container MUST match the exact dimensions/position of pdf-render-canvas via JS */
    pointer-events: none;
    overflow: hidden;
}

.live-page-number {
    position: absolute;
    transform-origin: center center;
    color: #000;
    font-size: 16px;
    white-space: pre-wrap;
    text-align: center;
    line-height: 1.1;
}

/* Button variants for page number tool (Matching the green category theme) */
.green-btn {
    background-color: #10B981 !important;
    color: white !important;
}

.green-btn:hover {
    background-color: #059669 !important;
}

.green-btn:disabled {
    background-color: #6EE7B7 !important;
    cursor: not-allowed;
}

.green-stroke {
    stroke: #10B981 !important;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 900px) {
    .editor-layout {
        /* allow native scrolling on mobile */
        height: auto;
        min-height: 100vh;
    }

    body.editor-mode {
        overflow: auto;
        height: auto;
    }

    .editor-body {
        flex-direction: column;
        overflow: visible;
    }

    .pdf-viewer-pane {
        /* let the viewer be as tall as it needs or set to a good static height */
        min-height: 50vh;
        overflow: visible;
    }

    .sidebar-pane {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        /* cancel fixed scrolling, let native scroll rule */
        flex-shrink: 0;
    }

    .tab-content-container {
        /* remove fixed scroll inside tab container on mobile */
        overflow-y: visible;
    }

    .editor-header {
        /* Allow links to scroll or wrap without breaking logo */
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
        gap: 12px;
    }

    .header-related-links {
        width: 100%;
        order: 3;
        text-align: center;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
    }

    .header-actions {
        order: 2;
    }
}