/**
 * Shared UI primitives.
 * Page-specific layout stays in each page stylesheet; this file only defines
 * controls, focus states and surface behavior shared across the app.
 */

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, textarea, select):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color) 52%, transparent);
    outline-offset: 2px;
}

::selection {
    color: #102018;
    background: color-mix(in srgb, var(--primary-color) 48%, white);
}

.form-input,
.tag-input-large,
.track-input {
    width: 100%;
    min-height: var(--control-height, 44px);
    padding: 0.72rem 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-input:hover,
.tag-input-large:hover,
.track-input:hover {
    border-color: color-mix(in srgb, var(--text-secondary) 48%, var(--border-medium));
}

.form-input:focus,
.tag-input-large:focus,
.track-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-bg-light);
    outline: none;
}

.action-btn,
.submit-btn,
.cancel-btn,
.page-btn,
.pagination-btn {
    min-height: var(--control-height, 44px);
    border-radius: var(--radius-lg);
}

.action-btn,
.submit-btn {
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

.action-btn:disabled,
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.empty-state {
    min-height: 140px;
    display: grid;
    place-items: center;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--bg-secondary) 72%, transparent);
}

/* Shared POP artwork for buttons and the POP feed header. */
.pop-pill-button-image {
    display: block;
    width: 48px;
    height: 22px;
    object-fit: contain;
}

.pop-pill-mark {
    display: block;
    width: 54px;
    height: 24px;
    object-fit: contain;
}

.feed-header-pop-image {
    display: block;
    width: 38px;
    height: 22px;
    object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
