@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #05070a;
    --bg-card: #0d1117;
    --bg-glass: rgba(13, 17, 23, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(88, 166, 255, 0.4);
    --accent-blue: #58a6ff;
    --accent-purple: #8b5cf6;
    --accent-blue-raw: 88, 166, 255;
    --accent-purple-raw: 139, 92, 246;
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --card-lift: translateY(-4px) scale(1.02);
    --transition-card: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.1), transparent),
        radial-gradient(circle at 0% 100%, rgba(139, 92, 246, 0.05), transparent);
    background-attachment: fixed;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* Mobile Category Scroll */
.category-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    margin: 0 -1.5rem; /* Bleed to edges */
}
.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* =====================================================
   TOOL CARD — PREMIUM INTERACTION & GLOW SYSTEM
   ===================================================== */
.tool-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    transition: var(--transition-card);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    /* Contain the ::before shimmer inside the card boundary */
    will-change: transform, box-shadow;
}

/* Mouse-relative shimmer layer (position driven by JS via CSS vars --mx/--my) */
.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        380px circle at var(--mx, 50%) var(--my, 50%),
        rgba(var(--accent-blue-raw), 0.10) 0%,
        rgba(var(--accent-purple-raw), 0.05) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}
.tool-card:hover::after {
    opacity: 1;
}

/* Diagonal sweep shimmer on hover */
.tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(88, 166, 255, 0.05) 50%,
        rgba(139, 92, 246, 0.04) 60%,
        transparent 70%
    );
    transform: translateX(-120%) skewX(-15deg);
    transition: transform 0.55s ease;
    pointer-events: none;
    z-index: 0;
}
.tool-card:hover::before {
    transform: translateX(120%) skewX(-15deg);
}

/* Ensure all card children sit above glow layers */
.tool-card > * {
    position: relative;
    z-index: 1;
}

.tool-card:hover {
    transform: var(--card-lift);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(88, 166, 255, 0.45);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(88, 166, 255, 0.18),
        0 0 40px rgba(88, 166, 255, 0.12),
        0 0 80px rgba(139, 92, 246, 0.06);
}

#catDropdownBtn:hover {
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
    transform: scale(1.02);
}

/* Legacy card-glow div support (kept for backward compat) */
.card-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--x, 50%) var(--y, 50%),
        rgba(88, 166, 255, 0.18) 0%,
        rgba(139, 92, 246, 0.08) 40%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
    z-index: 0;
}
.tool-card:hover .card-glow { opacity: 1; }

/* =====================================================
   PREMIUM TEXT GRADIENT SYSTEM
   ===================================================== */

/* Original — kept for existing usage */
.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* NEW — Vivid blue-to-purple for comparison headers, collection titles */
.gradient-text-vivid {
    background: linear-gradient(
        110deg,
        #ffffff  0%,
        #58a6ff  45%,
        #a78bfa  80%,
        #c084fc  100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
    background-size: 200% auto;
    animation: gradient-shift 6s linear infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0%   center; }
    50%  { background-position: 100% center; }
    100% { background-position: 0%   center; }
}

/* Elite (white→blue) — unchanged class extended */
.gradient-text-elite {
    background: linear-gradient(135deg, #fff 0%, #58a6ff 55%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.premium-btn {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    transition: opacity 0.2s;
}

.premium-btn:hover {
    opacity: 0.9;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.2);
    border-radius: 20px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 166, 255, 0.4);
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.badge-featured {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.2);
}

.badge-platinum {
    background: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

.badge-gold {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
    color: white !important;
    border: none !important;
}

.category-tag {
    transition: all 0.2s;
}

.category-tag.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Mobile Compact View Adjustments */
@media (max-width: 640px) {
    .tool-card {
        padding: 1rem !important;
    }
    .tool-card h3 {
        font-size: 0.95rem !important;
        margin-bottom: 0.25rem !important;
    }
    .tool-card p {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 2 !important;
    }
    .badge {
        font-size: 0.65rem !important;
        padding: 1px 6px !important;
    }
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1.5rem;
}

.bento-item {
    grid-column: span 1;
    grid-row: span 1;
}

.bento-item-large {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .bento-item-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}
/* --- ELITE BRANDING & MONETIZATION STYLES --- */

.platinum-glow {
    position: relative;
    border-color: rgba(234, 179, 8, 0.4) !important;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.05) 0%, rgba(13, 17, 23, 1) 100%) !important;
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.1), inset 0 0 10px rgba(234, 179, 8, 0.05);
}

.verified-shimmer {
    position: relative;
    overflow: hidden;
}

.verified-shimmer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: rotate(45deg);
    animation: shimmer 4s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* =====================================================
   AUTHORITY & PLATINUM BADGES — RADIAL SHIMMER PULSE
   ===================================================== */

.authority-badge, .platinum-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 9px;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Radial shimmer ripple — pulls eye naturally */
.authority-badge::after, .platinum-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.22), transparent 70%);
    opacity: 0;
    animation: badge-pulse 2.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-pulse {
    0%,  100% { opacity: 0;    transform: scaleX(0.6) scaleY(0.4); }
    40%        { opacity: 1;    transform: scaleX(1.1) scaleY(1.2); }
    70%        { opacity: 0.4;  transform: scaleX(1.0) scaleY(1.0); }
}

.authority-badge {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.25);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.15);
    animation: authority-glow 3s ease-in-out infinite;
}

@keyframes authority-glow {
    0%,  100% { box-shadow: 0 0 6px  rgba(88, 166, 255, 0.15); }
    50%        { box-shadow: 0 0 16px rgba(88, 166, 255, 0.35); }
}

.platinum-badge {
    background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(234,179,8,0.05));
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.35);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.15);
    animation: platinum-glow 3s ease-in-out infinite;
}

@keyframes platinum-glow {
    0%,  100% { box-shadow: 0 0 6px  rgba(234, 179, 8, 0.15); }
    50%        { box-shadow: 0 0 18px rgba(234, 179, 8, 0.35); }
}

.battle-tag {
    background: #ef4444;
    color: white;
    font-size: 8px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

.gradient-text-elite {
    background: linear-gradient(135deg, #fff 0%, #58a6ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Enhanced CTA Glow */
.btn-elite {
    background: #58a6ff;
    color: #0b0e14;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
    transition: all 0.3s;
}

.btn-elite:hover {
    box-shadow: 0 0 35px rgba(88, 166, 255, 0.5);
    transform: scale(1.02);
}

/* --- ELITE INTERACTION EFFECTS --- */

#searchInput:focus, #mobileSearchInput:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.2);
    background: rgba(11, 14, 20, 0.8) !important;
    outline: none;
}

.shimmer-btn-elite {
    position: relative;
    overflow: hidden;
}

.shimmer-btn-elite::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: button-shimmer 3s infinite;
    pointer-events: none;
}

@keyframes button-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.mobile-nav-glow {
    position: relative;
    box-shadow: -10px 0 30px rgba(88, 166, 255, 0.1);
}

.mobile-nav-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(88, 166, 255, 0.05), transparent 70%);
    pointer-events: none;
}

/* =====================================================
   AD CONTAINERS — BENTO-INTEGRATED, PROFESSIONAL
   ===================================================== */

/* Legacy .ad-slot kept for backward compat */
.ad-slot {
    background: rgba(11, 14, 20, 0.8);
    border: 1px dashed rgba(88, 166, 255, 0.2);
    border-radius: 1.5rem;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.ad-slot:hover {
    border-color: rgba(88, 166, 255, 0.4);
    background: rgba(11, 14, 20, 1);
}

/* NEW — Primary bento-compatible ad wrapper */
.ad-container {
    position: relative;
    background: rgba(11, 14, 20, 0.75);
    border: 1px dashed rgba(88, 166, 255, 0.18);
    border-radius: 1.25rem;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* Fluid padding: scales from 12px on mobile to 24px on desktop */
    padding: clamp(0.75rem, 2.5vw, 1.5rem);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-container:hover {
    border-color: rgba(88, 166, 255, 0.32);
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.06), inset 0 0 20px rgba(88, 166, 255, 0.03);
}

/* Subtle inner noise texture for depth */
.ad-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(88, 166, 255, 0.04), transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.03), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* SPONSORED RESOURCING watermark label */
.ad-container::after {
    content: 'SPONSORED RESOURCING';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(88, 166, 255, 0.08);
    color: rgba(88, 166, 255, 0.55);
    font-size: 7px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 3px 14px;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-top: none;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

/* All ad-container children above pseudo layers */
.ad-container > * {
    position: relative;
    z-index: 1;
}

/* Fluid mobile degradation for affiliate click surface */
@media (max-width: 640px) {
    .ad-container {
        border-radius: 1rem;
        min-height: 160px;
        /* Push the ad unit naturally within thumb-reach zone */
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    .ad-container::after {
        font-size: 6px;
        letter-spacing: 0.15em;
        padding: 3px 10px;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
}

.custom-toast {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0f6fc;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.custom-toast.success { border-left: 4px solid #10b981; }
.custom-toast.error { border-left: 4px solid #ef4444; }
.custom-toast.info { border-left: 4px solid #3b82f6; }

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-toast.success .toast-icon { color: #10b981; }
.custom-toast.error .toast-icon { color: #ef4444; }
.custom-toast.info .toast-icon { color: #3b82f6; }
