/* ============================================================================
   ICON & COLOR PICKER
   ============================================================================ */

.icon-color-picker {
    /* position set by inline styles - DO NOT override */
    background: var(--bg-main) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-2) !important;
    padding: 16px !important;
    width: 320px !important;
    max-height: 450px !important;
    overflow-y: auto !important;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.picker-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.picker-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.picker-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.picker-section {
    margin-bottom: 16px;
}

.picker-section:last-child {
    margin-bottom: 0;
}

.picker-section-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-1);
}

.icon-picker-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.icon-picker-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-picker-item.selected {
    background: var(--accent-blue-opacity-15);
    color: var(--accent-blue);
}

.icon-picker-item svg {
    width: 16px;
    height: 16px;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: var(--space-1-5);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-circle);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-main);
}

.color-swatch svg {
    width: 12px;
    height: 12px;
    color: white;
}

.color-swatch.custom-color-btn {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-medium);
}

.color-swatch.custom-color-btn:hover {
    border-color: var(--text-tertiary);
}

.color-swatch.custom-color-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
}

/* Make icon triggers clickable */
.icon-picker-trigger {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.icon-picker-trigger:hover {
    transform: scale(1.05);
}

/* ============================================================================
   CONFIRMATION DIALOG
   ============================================================================ */

.confirm-dialog-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay-bg);
    z-index: calc(var(--z-layer-modal) + 1);
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-in-out);
}

.confirm-dialog-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.confirm-dialog {
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-3);
    text-align: center;
    transform: scale(0.95);
    transition: transform var(--duration-normal) var(--ease-in-out);
}

.confirm-dialog-overlay.visible .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--color-danger-light);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-red-text);
}

.confirm-dialog-icon.danger {
    background: var(--color-danger-light);
}

.confirm-dialog-icon.danger svg {
    color: var(--color-red-text);
}

.confirm-dialog-icon.archive {
    background: var(--accent-green-light);
}

.confirm-dialog-icon.archive svg {
    color: var(--color-green-text);
}

.confirm-dialog-title {
    font-size: var(--font-size-18);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.confirm-dialog-message {
    font-size: var(--font-size-14);
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.confirm-dialog-btn {
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--font-size-14);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 100px;
}

.confirm-dialog-btn.cancel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.confirm-dialog-btn.cancel:hover {
    background: var(--bg-hover);
}

.confirm-dialog-btn.danger {
    background: var(--color-red-fill);
    border: 1px solid var(--color-red-fill);
    color: white;
}

.confirm-dialog-btn.danger:hover {
    background: var(--color-red-fill-hover);
    border-color: var(--color-red-fill-hover);
}

.confirm-dialog-btn.archive {
    background: var(--color-green-fill);
    border: 1px solid var(--color-green-fill);
    color: white;
}

.confirm-dialog-btn.archive:hover {
    background: var(--color-green-fill-hover);
    border-color: var(--color-green-fill-hover);
}

.confirm-dialog-btn.default {
    background: var(--accent-fill);
    border: 1px solid var(--accent-fill);
    color: white;
}

.confirm-dialog-btn.default:hover {
    background: var(--accent-fill-hover);
    border-color: var(--accent-fill-hover);
}

.confirm-dialog-btn.secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.confirm-dialog-btn.secondary:hover {
    background: var(--accent-blue-light);
}

.confirm-dialog-icon.default {
    background: var(--accent-blue-light);
}

.confirm-dialog-icon.default svg {
    color: var(--accent-blue);
}

/* ============================================================================
   INPUT DIALOG
   ============================================================================ */

.input-dialog-label {
    display: block;
    font-size: var(--font-size-12);
    font-weight: 600;
    color: #6b7280;
    margin: 8px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-dialog-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: var(--font-size-14);
    color: #1A1A2E;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: #ffffff;
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-in-out);
    box-sizing: border-box;
}

.input-dialog-input:focus {
    border-color: #4A90D9;
}

.input-dialog-error {
    font-size: var(--font-size-12);
    color: var(--color-red-text);
    margin: 6px 0 0;
    min-height: 16px;
}

/* Dark mode. `Settings.applyTheme` puts `data-theme` on the ROOT element and
   REMOVES it for 'system'; nothing in the app sets `body.dark-theme`. Both
   halves are required: the attribute rule so an explicit dark choice wins on a
   light OS, and the `:not([data-theme="light"])`-guarded media query so the OS
   preference yields to an explicit light choice.
   MEASURED CAVEAT: as the sheet stands today these four rules change nothing.
   The generic `[data-theme="dark"] input[type="text"]` rule further down
   already paints this field (`--bg-tertiary` / `--text-primary`) and, at one
   more specificity point, out-specifies every declaration here; the focus
   border comes from the global `input:focus-visible` rule near the top of the
   file, which is `!important`. They are kept, converted rather than deleted,
   so that the component still carries its own dark styling if either of those
   broader rules is ever scoped — and so that no `body.dark-theme` selector
   survives to be copied into the next component. */
[data-theme="dark"] .input-dialog-input {
    background: #2a2a3e;
    color: #F5F5F7;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .input-dialog-input:focus {
    border-color: #4A90D9;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .input-dialog-input {
        background: #2a2a3e;
        color: #F5F5F7;
        border-color: rgba(255, 255, 255, 0.12);
    }

    :root:not([data-theme="light"]) .input-dialog-input:focus {
        border-color: #4A90D9;
    }
}
