/* ==========================================================================
   REW Wrestling - app.css
   Custom styles layered on top of Tailwind (CDN). Keep light & performance
   friendly: only what Tailwind utilities can't express.
   ========================================================================== */

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--rew-primary, #dc2626);
    color: var(--rew-btn-text, #fff);
}

/* ---------- Scrollbar (WebKit) ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0b0b0f;
}
::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 8px;
    border: 2px solid #0b0b0f;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--rew-primary, #dc2626);
}

/* ---------- Rich editor content (.prose) ---------- */
.prose {
    line-height: 1.75;
    color: inherit;
}
.prose > * + * {
    margin-top: 1rem;
}
.prose h1, .prose h2, .prose h3 {
    font-family: "Oswald", ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 1.75rem;
    line-height: 1.25;
}
.prose h1 { font-size: 1.75rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose p { margin-top: 0.75rem; }
.prose a {
    color: var(--rew-primary, #dc2626);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.prose a:hover { color: var(--rew-link-hover, #b91c1c); }
.prose ul, .prose ol {
    padding-left: 1.4rem;
    margin-top: 0.75rem;
    list-style: revert;
}
.prose blockquote {
    border-left: 4px solid var(--rew-primary, #dc2626);
    padding-left: 1rem;
    font-style: italic;
    color: #71717a;
}
.dark .prose blockquote { color: #a1a1aa; }
.prose img {
    border-radius: 0.75rem;
    margin-top: 1rem;
}
.prose iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

/* ---------- Hero Slider ---------- */
.hero-slide,
.rew-hero-slide {
    transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1), transform 700ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide.is-active,
.rew-hero-slide.is-active {
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
}
.rew-hero-slide .rew-slide-img {
    transition: transform 8000ms cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(1);
}
.rew-hero-slide.is-active .rew-slide-img {
    transform: scale(1.07);
}

/* Staggered text animations for active slide */
.rew-hero-slide .rew-badge-anim,
.rew-hero-slide .rew-title-anim,
.rew-hero-slide .rew-subtitle-anim,
.rew-hero-slide .rew-button-anim {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rew-hero-slide.is-active .rew-badge-anim {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 200ms;
}
.rew-hero-slide.is-active .rew-title-anim {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 350ms;
}
.rew-hero-slide.is-active .rew-subtitle-anim {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 500ms;
}
.rew-hero-slide.is-active .rew-button-anim {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 650ms;
}

.hero-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.15) 100%);
}

/* ---------- Skeleton shimmer ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e4e4e7;
}
.dark .skeleton {
    background: #27272a;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* ---------- Micro animations ---------- */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fade-in-up 500ms ease-out both;
}

/* ---------- Popup ad overlay ---------- */
/* Lock background scrolling while the popup ad is open (desktop + mobile). */
html.popup-open,
html.popup-open body {
    overflow: hidden;
}

@keyframes ticker-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
.live-dot {
    animation: ticker-pulse 1.4s ease-in-out infinite;
}

/* ---------- Card hover lift ---------- */
.card-hover {
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.35);
}

/* ---------- Image hover zoom ---------- */
.img-zoom {
    overflow: hidden;
}
.img-zoom img {
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.img-zoom:hover img {
    transform: scale(1.06);
}

/* ---------- Admin tables ---------- */
.admin-table tbody tr {
    transition: background-color 150ms ease;
}
.admin-table tbody tr:hover {
    background-color: color-mix(in srgb, var(--rew-primary, #dc2626) 4%, transparent);
}

/* ---------- Admin shell (redesigned dashboard) ---------- */

/* Glassy sticky topbar */
.admin-topbar {
    background: rgba(243, 244, 246, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.dark .admin-topbar {
    background: rgba(11, 11, 15, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Slim dark scrollbar inside the admin sidebar nav */
.admin-scrollbar::-webkit-scrollbar {
    width: 5px;
}
.admin-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.admin-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border: 0;
}
.admin-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--rew-primary, #dc2626);
}

/* Dashboard hero: diagonal ring-canvas texture + red glow, front page only styling */
.rew-hero {
    background-image:
        radial-gradient(ellipse 60% 120% at 85% 20%, rgba(220, 38, 38, 0.35), transparent 60%),
        radial-gradient(ellipse 40% 90% at 10% 110%, rgba(220, 38, 38, 0.18), transparent 60%),
        repeating-linear-gradient(
            135deg,
            transparent 0px,
            transparent 14px,
            rgba(255, 255, 255, 0.035) 14px,
            rgba(255, 255, 255, 0.035) 16px
        );
}
.rew-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 50%, transparent 58%, rgba(220, 38, 38, 0.08) 59%, transparent 60%),
        radial-gradient(circle at 50% 50%, transparent 68%, rgba(255, 255, 255, 0.05) 68.6%, transparent 69.6%);
    background-size: 480px 480px, 480px 480px;
    background-position: 110% -40%, 110% -40%;
    background-repeat: no-repeat;
}

/* Stat cards: subtle lift on hover */
.rew-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -12px rgba(0, 0, 0, 0.25);
}
.dark .rew-stat-card:hover {
    box-shadow: 0 10px 25px -12px rgba(0, 0, 0, 0.8);
}

/* ---------- Focus visible (accessibility) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--rew-primary, #dc2626);
    outline-offset: 2px;
}

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

/* ---------- Social icons (brand color on hover via data-brand-color) ---------- */
.social-icon:hover {
    background-color: var(--rew-primary, var(--brand, #dc2626));
}
.dark .social-icon:hover {
    background-color: var(--rew-primary, var(--brand, #dc2626));
}

/* Header variant: brand glyph at rest, solid brand tile on hover.
   !important is required to override the inline brand `color`. */
.social-icon-header:hover {
    background-color: var(--rew-primary, var(--brand, #dc2626));
    color: #ffffff !important;
}
