/* ===== ANIMATED HERO BACKGROUND (Clean White) ===== */
/* Global Animations */
@keyframes flipIn {
    0% { opacity: 0; transform: perspective(1000px) rotateX(-90deg); }
    100% { opacity: 1; transform: perspective(1000px) rotateX(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* Observer Utilities */
.animate-on-scroll {
    opacity: 1;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}
.animate-on-scroll.start-hidden {
    opacity: 0;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: none;
}

.anim-fade-up { transform: translateY(30px); }
.anim-zoom-in { transform: scale(0.95); }
.anim-slide-down { transform: translateY(-30px); }
.anim-flip-in {
    transform: perspective(1000px) rotateX(-90deg);
    transform-origin: center top;
}

/* Stagger Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

.premium-hero {
    background: #fff;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.premium-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== GLASSMORPHISM HERO CARD (Full Width) ===== */
.hero-glass-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 0 24px 24px;
    border: none;
    padding: 10px 10px 30px;
    width: 100%;
    max-width: 100%;
    margin: -10px auto 0;
    position: relative;
    z-index: 1;
}
.home_area { width: 100%; max-width: 100%; overflow-x: hidden; }
.hero-title {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 10px;
    animation: slideDown 0.8s ease-out forwards;
}
.hero-title .highlight {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    color: #475569;
    font-size: 1rem;
    margin-bottom: 15px;
}

/* ===== SEARCH BAR ===== */
.search-glass {
    display: flex;
    background: rgba(255,255,255,0.95);
    border-radius: 60px;
    padding: 8px;
    max-width: 550px;
    margin: 0 auto 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    animation: zoomIn 0.8s ease-out 0.3s forwards;
    opacity: 0;
}
.search-glass input {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    background: transparent;
    outline: none;
}
.search-glass button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.search-glass button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(118,75,162,0.4);
}
.hero-search-wrapper {
    position: relative;
    max-width: 550px;
    margin: 0 auto 15px;
    z-index: 100;
}
.hero-search-wrapper .search-glass { margin: 0; }
.hero-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    margin-top: 10px;
}
.hero-search-dropdown.active { display: block; }
.hero-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}
.hero-search-item:hover {
    background: linear-gradient(135deg, #667eea15, #764ba215);
}
.hero-search-item i {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.hero-search-item span { font-weight: 600; }

/* ===== COLORFUL CATEGORY PILLS ===== */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    max-width: 100%;
    padding: 0 20px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    white-space: nowrap;
    opacity: 0;
    animation: fadeUp 0.5s ease-out forwards;
}
.cat-pill:hover {
    transform: translateY(-4px) scale(1.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    color: #fff !important;
    z-index: 10;
}
.cat-pill i { font-size: 16px; }
.cat-pill:nth-child(7n+1) { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.cat-pill:nth-child(7n+2) { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.cat-pill:nth-child(7n+3) { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.cat-pill:nth-child(7n+4) { background: linear-gradient(135deg, #fa709a, #fee140); }
.cat-pill:nth-child(7n+5) { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.cat-pill:nth-child(7n+6) { background: linear-gradient(135deg, #ff9a9e, #fecfef); }
.cat-pill:nth-child(7n+7) { background: linear-gradient(135deg, #667eea, #764ba2); }

/* ===== STATS SECTION ===== */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 30px 10px;
    background: transparent;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}
.stat-card {
    text-align: center;
    padding: 0 10px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    min-width: 120px;
    flex: 1;
    border-right: 1px solid #e2e8f0;
}
.stat-card:last-child { border-right: none; }
.stat-card:hover { transform: none; }
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    background: none;
    -webkit-text-fill-color: initial;
    margin-bottom: 2px;
}
.stat-label {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TRUST BADGES ===== */
.trust-badges-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 10px 30px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid #eef2f6;
    transition: all 0.3s;
}
.trust-item:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}
.trust-icon { font-size: 1.5rem; color: #0ea5e9; display: flex; align-items: center; }
.trust-text { display: flex; flex-direction: column; }
.trust-title { font-weight: 700; color: #334155; font-size: 0.95rem; }
.trust-desc { font-size: 0.8rem; color: #94a3b8; }
@media (max-width: 768px) {
    .trust-badges-section { gap: 15px; padding-bottom: 30px; }
    .trust-item { padding: 10px 15px; flex: 1 1 40%; min-width: 140px; }
    .trust-icon { font-size: 1.2rem; }
    .trust-title { font-size: 0.85rem; }
    .trust-desc { display: none; }
}

/* ===== TOOL CARDS SECTION ===== */
.tools-section {
    padding: 20px 48px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.view-all-link {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
}
.view-all-link:hover { gap: 10px; color: #764ba2; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 0;
}
.tool-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 245, 245, 0.9));
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 10px 10px 15px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    margin: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, #667eea, transparent, #764ba2);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(102,126,234,0.3), 0 0 30px rgba(102,126,234,0.15);
    border-color: #667eea;
}
.tool-icon {
    width: 148px;
    height: 132px;
    margin: 0 auto 8px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    overflow: visible;
    flex-shrink: 0;
}
.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    mix-blend-mode: multiply;
    transform: scale(1);
}
.tool-icon i {
    font-size: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(102,126,234,0.3);
}
.tool-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.25;
}
.tool-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .premium-hero { padding: 0; }
    .hero-glass-card { padding: 30px 15px; border-radius: 0 0 20px 20px; }
    .hero-title { font-size: 1.6rem; }
    .hero-subtitle { font-size: 0.95rem; padding: 0 10px; }
    .search-glass { flex-direction: column; border-radius: 20px; padding: 10px; }
    .search-glass input { width: 100%; text-align: center; margin-bottom: 10px; }
    .search-glass button { width: 100%; border-radius: 12px; }
    .stats-section { gap: 15px; padding: 30px 15px; }
    .stat-card { min-width: 45%; flex: 1; padding: 10px; }
    .stat-number { font-size: 1.8rem; }
    .tools-section { padding: 15px 16px; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; justify-content: stretch; }
    .tool-card { padding: 15px 10px; min-height: 180px; }
    .tool-icon { width: 68px !important; height: 68px !important; }
    .tool-icon img { transform: scale(1) !important; }
    .tool-icon i { font-size: 28px !important; }
    .tool-name { font-size: 0.85rem; }
}
@media (max-width: 480px) {
    .stats-section {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 20px 10px !important;
    }
    .stat-card {
        min-width: auto !important;
        padding: 12px 8px !important;
        border-right: none !important;
        border-bottom: none !important;
        margin-bottom: 0 !important;
    }
    .stat-number { font-size: 1.4rem !important; }
    .stat-label { font-size: 0.7rem !important; }
    .stat-card i { font-size: 18px !important; width: 44px !important; height: 44px !important; }
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        justify-content: stretch !important;
    }
    .tool-card {
        padding: 12px 8px !important;
        min-height: auto !important;
        border-radius: 12px !important;
    }
    .tool-icon { width: 58px !important; height: 58px !important; margin-bottom: 6px !important; }
    .tool-icon img { transform: scale(1) !important; }
    .tool-name { font-size: 0.75rem !important; margin-bottom: 2px !important; line-height: 1.2 !important; }
    .tool-desc { font-size: 0.65rem !important; -webkit-line-clamp: 1 !important; }
    .hero-title { font-size: 1.35rem !important; }
    .hero-subtitle { font-size: 0.85rem !important; }
    .category-pills { gap: 6px !important; padding: 0 10px !important; }
    .cat-pill { padding: 6px 12px !important; font-size: 12px !important; min-height: 44px; display: inline-flex; align-items: center; }
}

/* ===== TRENDING TOOLS SECTION ===== */
.trending-section { margin-bottom: 10px; }
.trending-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 16px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.trending-scroll::-webkit-scrollbar { height: 6px; }
.trending-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.trending-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 240px;
    max-width: 280px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    text-decoration: none;
    scroll-snap-align: start;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.trending-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102,126,234,0.18);
    border-color: #667eea;
}
.trending-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
}
.trending-icon img { width: 100%; height: 100%; object-fit: contain; }
.trending-icon i {
    font-size: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.trending-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trending-name {
    font-size: 0.88rem; font-weight: 700; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trending-cat {
    font-size: 0.72rem; color: #94a3b8; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .trending-card { min-width: 200px; padding: 12px 14px; }
    .trending-icon { width: 40px; height: 40px; }
    .trending-name { font-size: 0.82rem; }
}
@media (max-width: 480px) {
    .trending-card { min-width: 180px; padding: 10px 12px; gap: 10px; }
    .trending-icon { width: 44px; height: 44px; border-radius: 8px; }
    .trending-name { font-size: 0.78rem; }
    .trending-cat { font-size: 0.65rem; }
}

.cat-divider { border: none; height: 1px; background: #e2e8f0; margin: 40px 0; }
#noResults { text-align: center; color: #64748b; padding: 40px; font-size: 1.1rem; }

/* ===== ACCESSIBILITY: Reduce Motion Fix ===== */
@media (prefers-reduced-motion: reduce) {
    .search-glass {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
    .cat-pill {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
