/*
 * OptionsPlay Shared Widget Shell Components
 * Source: Design System Spec Section 5.1
 * Replaces duplicated widget container/header/body styles
 */

/* ===== WIDGET CONTAINER ===== */
.op-widget {
    padding: 0;
    background: var(--op-bg-primary);
    border-radius: var(--op-radius-xl);
    box-shadow: var(--op-shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ===== WIDGET HEADER ===== */
.op-widget-header {
    padding: var(--op-space-4) var(--op-space-6);
    background: linear-gradient(135deg, var(--op-bg-secondary) 0%, var(--op-bg-primary) 100%);
    border-bottom: 1px solid var(--op-border-default);
}

/* ===== WIDGET BODY ===== */
.op-widget-body {
    flex: 1;
    padding: var(--op-space-6);
    overflow-y: auto;
}

/* ===== WIDGET CONTENT (scrollable, hidden scrollbar) ===== */
/* For visible thin scrollbar, add .op-thin-scrollbar class (see scrollbars.css) */
.op-widget-content {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.op-widget-content::-webkit-scrollbar {
    display: none;
}

/* ===== LOADING STATE ===== */
.op-widget-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.op-widget-loading p,
.op-widget-loading span {
    margin-top: var(--op-space-4);
    color: var(--op-text-secondary);
}

/* ===== ERROR STATE ===== */
.op-widget-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

.op-widget-error p {
    margin-top: var(--op-space-4);
    color: var(--op-text-secondary);
}

.op-widget-error ::deep .rzi {
    color: var(--op-error-500);
}

/* ===== RESPONSIVE HINT ===== */
/* Shared feedback banner when grid columns are hidden */
.op-responsive-hint {
    display: flex;
    align-items: center;
    gap: var(--op-space-2);
    padding: var(--op-space-2) var(--op-space-4);
    margin: var(--op-space-2) var(--op-space-4) var(--op-space-3);
    background: var(--op-warning-100);
    border: 1px solid var(--op-warning-400);
    border-radius: var(--op-radius-md);
    font-size: 0.8125rem;
    color: var(--op-warning-800);
}

.op-responsive-hint.narrow {
    background: var(--op-info-100);
    border-color: var(--op-info-500);
    color: var(--op-info-800);
}

/* ===== LOADING SPINNER (base-rendered) ===== */
.op-widget-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--op-border-default, #e5e7eb);
    border-top-color: var(--rz-primary, #0078d4);
    border-radius: 50%;
    animation: op-spin 0.8s linear infinite;
}

@keyframes op-spin {
    to { transform: rotate(360deg); }
}

/* ===== NOT AUTHENTICATED STATE ===== */
.op-widget-auth-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    gap: var(--op-space-3, 0.75rem);
}

.op-widget-auth-icon {
    font-size: 40px;
    color: var(--op-text-tertiary, #9ca3af);
}

.op-widget-auth-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--op-text-secondary, #6b7280);
}

/* ===== NOT AUTHORIZED (LOCK) STATE ===== */
.op-widget-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    gap: var(--op-space-2, 0.5rem);
}

.op-widget-locked-icon {
    font-size: 40px;
    color: var(--op-text-tertiary, #9ca3af);
}

.op-widget-locked-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--op-text-primary, #111827);
}

.op-widget-locked-desc {
    font-size: 0.8125rem;
    color: var(--op-text-secondary, #6b7280);
    max-width: 220px;
}

/* ===== FOMO OVERLAY (widget-level) ===== */
.op-widget-fomo-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.op-widget-fomo-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.op-widget-fomo-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.op-widget-fomo-message {
    background: var(--op-bg-primary, #fff);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--op-space-2, 0.5rem);
}

.op-widget-fomo-icon {
    font-size: 32px;
    color: var(--rz-primary, #0078d4);
}

.op-widget-fomo-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--op-text-primary, #111827);
}

.op-widget-fomo-desc {
    font-size: 0.8125rem;
    color: var(--op-text-secondary, #6b7280);
    line-height: 1.4;
}

.op-widget-fomo-cta {
    display: inline-block;
    margin-top: var(--op-space-3, 0.75rem);
    padding: 8px 24px;
    background: var(--rz-primary, #0078d4);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.op-widget-fomo-cta:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* Dark mode overrides */
[data-theme="dark"] .op-widget-fomo-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .op-widget-fomo-message {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== COMING SOON ===== */
.op-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--op-neutral-400);
}

.op-coming-soon ::deep .rzi {
    font-size: 48px;
    margin-bottom: 1rem;
}
