/* Modals and overlays */

.modal {
    backdrop-filter: blur(4px);
    z-index: 10100;
}

body.modal-open .character-notification,
body.modal-open .back-to-top-btn,
body.modal-open .badge-popover-wrapper,
body.modal-open .badge-popover,
body.modal-open .admin-tag-container,
body.modal-open .admin-tag-toggle,
body.modal-open .support-popup-overlay,
body.modal-open #cookieBanner,
body.modal-open .cookie-settings-modal {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Compact page modals (detail page, warbands, etc.) */
.modal-page .modal-content {
    width: min(96vw, 600px);
    max-width: 600px;
    height: auto;
    max-height: min(92dvh, 720px);
    overflow: hidden;
}

.modal-page .modal-body {
    overflow-y: auto;
}

.form-input.is-readonly,
.form-textarea.is-readonly {
    background-color: var(--color-bg-primary);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.modal-content {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    color: var(--color-text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-lg) var(--space-xl);
}

.modal-header h2,
.modal-header h3 {
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-weight: normal;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
}

.modal-close,
.close-modal {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover,
.close-modal:hover {
    color: var(--color-accent);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.badge-popover {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
}

/* Admin tables */
.admin-table,
table.data-table {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table th,
table.data-table th {
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border-strong);
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.admin-table td,
table.data-table td {
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.admin-table tr:hover td,
table.data-table tr:hover td {
    background: var(--color-accent-muted);
}

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dashboard-card h2,
.dashboard-card h3 {
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-weight: normal;
}
