/**
 * KalwiStore Global Halloween Theme ("Haunted Minecraft Realm")
 *
 * Non-destructive global theme override activated when `body.kw-theme-halloween` is present.
 * Transforms Navbar, Header, Announcement Bar, Sidebar, Category Cards, Product Cards,
 * Buttons, Leaderboard, Order History, Footer, and Atmospheric Particles without
 * breaking existing grid or responsive layouts.
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Creepster&display=swap');

:root {
    --hw-global-primary: #ff6b00;
    --hw-global-amber: #ff9e00;
    --hw-global-secondary: #9d4edd;
    --hw-global-necro: #39ff14;
    --hw-global-bg: #0d0714;
    --hw-global-obsidian: #121216;
}

/* =====================================================
   1. BODY & BACKGROUND
   ===================================================== */
html.kw-theme-halloween,
body.kw-theme-halloween {
    background-color: var(--hw-global-bg) !important;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(157, 78, 221, 0.18), transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(255, 107, 0, 0.16), transparent 45%),
        linear-gradient(180deg, var(--hw-global-bg) 0%, var(--hw-global-obsidian) 50%, #07040b 100%) !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center top !important;
    min-height: 100vh !important;
    color: #e9d5ff !important;
}

body.kw-theme-halloween .kw-layout,
body.kw-theme-halloween .kw-content,
body.kw-theme-halloween .kw-sidebar {
    background: transparent !important;
}

/* Optional Spooky Cursor */
body.kw-theme-halloween.hw-custom-cursor,
body.kw-theme-halloween.hw-custom-cursor a,
body.kw-theme-halloween.hw-custom-cursor button {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' style='font-size:20px'><text y='20'>🎃</text></svg>") 6 6, pointer;
}

/* =====================================================
   2. HEADER & HERO OVERLAY
   ===================================================== */
body.kw-theme-halloween .kw-header::before {
    background: linear-gradient(
        180deg,
        rgba(13, 7, 20, 0.45) 0%,
        rgba(24, 10, 41, 0.78) 60%,
        var(--hw-global-bg) 100%
    ) !important;
}

body.kw-theme-halloween .join-icon {
    background: rgba(255, 107, 0, 0.16) !important;
    border-color: rgba(255, 107, 0, 0.45) !important;
    color: var(--hw-global-amber) !important;
    box-shadow: 0 0 18px rgba(255, 107, 0, 0.3);
}

body.kw-theme-halloween .join-link {
    color: var(--hw-global-amber) !important;
}

/* =====================================================
   3. ANNOUNCEMENT BAR & NAVBAR
   ===================================================== */
body.kw-theme-halloween .kw-announcement {
    background: linear-gradient(135deg, rgba(22, 12, 38, 0.95), rgba(18, 18, 22, 0.96)) !important;
    border: 1px solid rgba(255, 107, 0, 0.35) !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), 0 0 24px rgba(157, 78, 221, 0.18) !important;
}

body.kw-theme-halloween .store-icon-box {
    background: rgba(255, 107, 0, 0.16) !important;
    border: 1px solid rgba(255, 107, 0, 0.4);
    color: var(--hw-global-primary) !important;
    box-shadow: 0 0 16px rgba(255, 107, 0, 0.25);
}

body.kw-theme-halloween .store-title {
    font-family: 'Cinzel Decorative', serif;
    color: var(--hw-global-amber) !important;
    text-shadow: 0 0 12px rgba(255, 107, 0, 0.35);
}

body.kw-theme-halloween.hw-pumpkin-decor .store-title::after {
    content: ' 🎃';
    font-size: 17px;
}

body.kw-theme-halloween .rank-badge {
    background: rgba(157, 78, 221, 0.2) !important;
    color: #e9d5ff !important;
    border-color: rgba(157, 78, 221, 0.45) !important;
}

body.kw-theme-halloween .cart-btn,
body.kw-theme-halloween .login-btn-bar {
    background: linear-gradient(135deg, var(--hw-global-primary), var(--hw-global-amber)) !important;
    color: #0d0714 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 18px rgba(255, 107, 0, 0.38) !important;
}

body.kw-theme-halloween .cart-btn:hover,
body.kw-theme-halloween .login-btn-bar:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 26px rgba(255, 158, 0, 0.65) !important;
}

/* =====================================================
   4. SIDEBAR & TOP DONOR WIDGET
   ===================================================== */
body.kw-theme-halloween .sidebar-nav,
body.kw-theme-halloween .sidebar-top-donor {
    background: linear-gradient(165deg, rgba(22, 12, 36, 0.94), rgba(16, 13, 24, 0.96)) !important;
    border: 1px solid rgba(157, 78, 221, 0.32) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

body.kw-theme-halloween .sidebar-nav .nav-item:hover {
    background: rgba(157, 78, 221, 0.14) !important;
    color: #fff !important;
}

body.kw-theme-halloween .sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(255, 107, 0, 0.22), rgba(157, 78, 221, 0.12)) !important;
    color: var(--hw-global-amber) !important;
    border-left-color: var(--hw-global-primary) !important;
}

body.kw-theme-halloween .sidebar-top-donor-btn {
    background: linear-gradient(135deg, var(--hw-global-primary), var(--hw-global-amber)) !important;
    color: #0d0714 !important;
    font-weight: 800 !important;
}

/* =====================================================
   5. HOMEPAGE CATEGORY CARDS, WELCOME & NEWS
   ===================================================== */
body.kw-theme-halloween .cat-card {
    background: linear-gradient(135deg, #210f38 0%, #140b24 100%) !important;
    border: 1px solid rgba(255, 107, 0, 0.4) !important;
    border-bottom: 3px solid var(--hw-global-primary) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(157, 78, 221, 0.15);
}

body.kw-theme-halloween .cat-card:hover {
    border-color: var(--hw-global-amber) !important;
    box-shadow: 0 12px 34px rgba(255, 107, 0, 0.32), 0 0 18px rgba(157, 78, 221, 0.35) !important;
    transform: translateY(-3px);
}

body.kw-theme-halloween .cat-icon.ranks-icon,
body.kw-theme-halloween .cat-icon.coins-icon,
body.kw-theme-halloween .cat-icon.keys-icon {
    background: rgba(255, 107, 0, 0.18) !important;
    color: var(--hw-global-amber) !important;
    border: 1px solid rgba(255, 107, 0, 0.35);
}

body.kw-theme-halloween .welcome-card,
body.kw-theme-halloween .kw-category-header-box {
    background: linear-gradient(160deg, rgba(22, 12, 36, 0.94), rgba(16, 14, 22, 0.96)) !important;
    border: 1px solid rgba(157, 78, 221, 0.32) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
}

body.kw-theme-halloween .news-promo-header {
    background: linear-gradient(135deg, #240e3d 0%, #3b1354 60%, #4d1919 100%) !important;
    border: 1px solid rgba(255, 107, 0, 0.32);
    border-bottom: none;
}

body.kw-theme-halloween .news-promo-grid {
    background: rgba(18, 12, 29, 0.94) !important;
    border-color: rgba(157, 78, 221, 0.3) !important;
}

/* =====================================================
   6. PRODUCT CARDS (RANKS / GEMS / STORE) & BUTTONS
   ===================================================== */
body.kw-theme-halloween .kw-product-card {
    background:
        radial-gradient(circle at 50% 0%, rgba(157, 78, 221, 0.16), transparent 62%),
        rgba(18, 14, 28, 0.92) !important;
    border: 1px solid rgba(157, 78, 221, 0.34) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

body.kw-theme-halloween .kw-product-card:hover {
    border-color: var(--hw-global-primary) !important;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.65), 0 0 24px rgba(255, 107, 0, 0.3), 0 0 12px rgba(157, 78, 221, 0.35) !important;
    transform: translateY(-4px);
}

body.kw-theme-halloween .kw-product-card .product-price {
    color: var(--hw-global-amber) !important;
}

body.kw-theme-halloween .kw-btn-buy {
    background: linear-gradient(135deg, var(--hw-global-primary), var(--hw-global-amber)) !important;
    color: #0d0714 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 16px rgba(255, 107, 0, 0.32);
}

body.kw-theme-halloween .kw-btn-buy:hover {
    filter: brightness(1.08);
    color: #0d0714 !important;
    box-shadow: 0 0 24px rgba(255, 158, 0, 0.6);
}

/* =====================================================
   7. FOOTER
   ===================================================== */
body.kw-theme-halloween .kw-footer {
    background: linear-gradient(180deg, #130b20 0%, #09050e 100%) !important;
    border-top: 1px solid rgba(255, 107, 0, 0.35) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

body.kw-theme-halloween .kw-footer a {
    color: var(--hw-global-amber) !important;
}

/* =====================================================
   8. ATMOSPHERIC FOG, PARTICLES & PUMPKIN CORNERS
   ===================================================== */
.kw-hw-global-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9990;
    overflow: hidden;
}

.kw-hw-fog {
    position: absolute;
    bottom: -35px;
    left: -50%;
    width: 200%;
    height: 190px;
    background:
        radial-gradient(ellipse at 30% 80%, rgba(157, 78, 221, 0.16), transparent 62%),
        radial-gradient(ellipse at 70% 85%, rgba(57, 255, 20, 0.07), transparent 65%),
        linear-gradient(to top, rgba(13, 7, 20, 0.85), transparent);
    filter: blur(18px);
    animation: kwHwFogMove 22s ease-in-out infinite alternate;
}

@keyframes kwHwFogMove {
    0% { transform: translateX(-6%); }
    100% { transform: translateX(6%); }
}

.kw-hw-particle {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    opacity: 0;
    animation: kwHwParticleFloat linear infinite;
}

@keyframes kwHwParticleFloat {
    0% { transform: translateY(0) translateX(0) scale(0.8); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.45; }
    100% { transform: translateY(-90vh) translateX(32px) scale(0.2); opacity: 0; }
}

.kw-hw-corner {
    position: fixed;
    font-size: 32px;
    opacity: 0.26;
    filter: drop-shadow(0 0 12px rgba(255, 107, 0, 0.5));
    user-select: none;
}

.kw-hw-corner-left {
    top: 14px;
    left: 16px;
}

.kw-hw-corner-right {
    bottom: 16px;
    right: 18px;
    animation: kwHwPumpkinPulse 3s ease-in-out infinite alternate;
}

@keyframes kwHwPumpkinPulse {
    from { transform: scale(1) rotate(-4deg); filter: drop-shadow(0 0 8px #ff6b00); }
    to { transform: scale(1.1) rotate(4deg); filter: drop-shadow(0 0 18px #ff9e00); }
}

/* Scrollbar styling in Halloween mode */
body.kw-theme-halloween::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 0, 0.45);
    border-radius: 999px;
}
body.kw-theme-halloween::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 0, 0.75);
}

/* =====================================================
   9. NOTICE BANNER, ALERTS & SALE TIMER (RANKS / HOME)
   ===================================================== */
body.kw-theme-halloween .kw-notice-banner,
html.kw-theme-halloween .kw-notice-banner,
body.kw-theme-halloween .kw-rank-warning-banner {
    background: linear-gradient(135deg, rgba(34, 15, 56, 0.96) 0%, rgba(18, 10, 28, 0.98) 100%) !important;
    border: 1px solid rgba(255, 107, 0, 0.45) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 107, 0, 0.2) !important;
}

body.kw-theme-halloween .kw-notice-header {
    border-bottom: 1px dashed rgba(255, 107, 0, 0.28) !important;
}

body.kw-theme-halloween .kw-notice-title-wrap i {
    color: var(--hw-global-amber, #ff9e00) !important;
    filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.7));
}

body.kw-theme-halloween .kw-notice-title,
body.kw-theme-halloween .kw-rank-warning-title {
    color: #ffeedd !important;
    font-weight: 800 !important;
    text-shadow: 0 0 8px rgba(255, 107, 0, 0.35);
}

body.kw-theme-halloween .kw-notice-tag {
    color: #ff9e00 !important;
    background: rgba(255, 107, 0, 0.16) !important;
    border: 1px solid rgba(255, 107, 0, 0.5) !important;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

body.kw-theme-halloween .kw-notice-label {
    color: #ffeedd !important;
}

body.kw-theme-halloween .kw-notice-desc {
    color: #d8b4fe !important;
}

body.kw-theme-halloween .kw-icon-blue {
    background: rgba(255, 107, 0, 0.2) !important;
    color: #ff9e00 !important;
    border: 1px solid rgba(255, 107, 0, 0.45) !important;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

body.kw-theme-halloween .kw-icon-green {
    background: rgba(57, 255, 20, 0.16) !important;
    color: #39ff14 !important;
    border: 1px solid rgba(57, 255, 20, 0.4) !important;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

body.kw-theme-halloween .kw-icon-red {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

body.kw-theme-halloween .kw-sale-timer {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.2) 0%, rgba(157, 78, 221, 0.18) 100%) !important;
    border: 1px solid var(--hw-global-primary, #ff6b00) !important;
    color: var(--hw-global-amber, #ff9e00) !important;
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.25) !important;
}

body.kw-theme-halloween .kw-countdown {
    background: rgba(13, 7, 20, 0.6) !important;
    color: #39ff14 !important;
    border: 1px solid rgba(57, 255, 20, 0.3) !important;
}

body.kw-theme-halloween .kw-alert-warning {
    background: rgba(255, 107, 0, 0.16) !important;
    color: var(--hw-global-amber, #ff9e00) !important;
    border-left: 5px solid var(--hw-global-primary, #ff6b00) !important;
}

body.kw-theme-halloween .kw-alert-staff {
    background: linear-gradient(135deg, rgba(65, 18, 30, 0.95), rgba(30, 10, 24, 0.95)) !important;
    border-left: 5px solid #ef4444 !important;
    color: #fca5a5 !important;
}

/* Modal styling in Halloween mode */
body.kw-theme-halloween .modal-content,
body.kw-theme-halloween .kw-modal-box {
    background: #140d20 !important;
    border: 1px solid rgba(157, 78, 221, 0.35) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 107, 0, 0.2) !important;
    color: #e9d5ff !important;
}
body.kw-theme-halloween .modal-header {
    border-bottom: 1px solid rgba(157, 78, 221, 0.25) !important;
}
body.kw-theme-halloween .modal-footer {
    border-top: 1px solid rgba(157, 78, 221, 0.25) !important;
}

