
/* ---------- RESET & GLOBAL ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    background: #f8f9fc;
    color: #1e1f2a;
    line-height: 1.5;
}

/* ---------- VARIABLES ---------- */
:root {
    --primary-color: #FF3366;
    --secondary-color: #4A00E0;
    --dark-color: #1a1f2e;
    --gray-color: #5a6270;
    --light-gray: #f0f2f8;
    --gradient-pink: linear-gradient(135deg, #FF3366, #FF6B95);
    --gradient-purple: linear-gradient(135deg, #8E2DE2, #4A00E0);
    --gradient-blue: linear-gradient(135deg, #4facfe, #00f2fe);
    --gradient-orange: linear-gradient(135deg, #fa709a, #fee140);
    --gradient-green: linear-gradient(135deg, #43e97b, #38f9d7);
    --gradient-dark: linear-gradient(135deg, #0B1120, #1A2A3F);
    --box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

/* ========== HERO SECTION ========== */
.category-hero {
    background: var(--gradient-dark);
    color: white;
    padding: 40px 0 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: visible;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.category-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 40%, rgba(255,255,255,0.08) 2%, transparent 2.5%),
                      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05) 1.5%, transparent 2%);
    background-size: 50px 50px, 70px 70px;
    pointer-events: none;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 3;
    overflow: visible;
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    background: linear-gradient(to right, #FFFFFF, #E0E7FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hero-description {
    font-size: 1.28rem;
    margin-bottom: 1rem;
    opacity: 0.92;
    font-weight: 600;
    color: #eef2ff;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    justify-content: center;
}

/* Stat blocks */
.stat-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    padding: 0.4rem 1rem;
    border-radius: 60px;
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    color: #FFD966;
}

.stat-label {
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ---------- MAIN CONTAINER ---------- */
.category-main {
    max-width: 1280px;
    margin: 0 auto 70px;
    padding: 0 24px;
}

/* section header */
.tools-header {
    margin-bottom: 40px;
}

.tools-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0b1120;
    margin-bottom: 0.5rem;
}

.tools-header p {
    font-size: 1.1rem;
    color: #4b5565;
}

/* ========== EXACT TOOLS GRID MEDIA QUERIES ========== */
/* Base: Desktop default */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 1280px;
    margin: 0 auto 3rem;
}

/* Tablet / small laptop */
@media (max-width: 991px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Normal mobile */
@media (max-width: 575px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Very small devices (≤359px) */
@media (max-width: 359px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== BLACK GLASS TOOL CARD ========== */
.tool-card {
    position: relative;
    background: radial-gradient(circle at top left, rgba(25, 25, 25, 0.75), rgba(0, 0, 0, 0.9));
    backdrop-filter: blur(22px) saturate(180%) contrast(120%);
    -webkit-backdrop-filter: blur(22px) saturate(180%) contrast(120%);
    border-radius: 22px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 20px 45px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0.75rem;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: 150px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(.22,.61,.36,1), box-shadow 0.4s cubic-bezier(.22,.61,.36,1);
    text-decoration: none;
}

/* HOVER LIFT */
.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12), 0 35px 70px rgba(0, 0, 0, 0.5);
}

/* PREMIUM GLASS SHINE */
.tool-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 40%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 60%
    );
    transform: translateX(-120%) skewX(-20deg);
    animation: glassShine 4.5s ease-in-out infinite;
    animation-play-state: paused;
    pointer-events: none;
    z-index: 2;
}

.tool-card:hover::before {
    animation-play-state: running;
}

@keyframes glassShine {
    0% {
        transform: translateX(-120%) skewX(-20deg);
    }
    60% {
        transform: translateX(120%) skewX(-20deg);
    }
    100% {
        transform: translateX(120%) skewX(-20deg);
    }
}

/* NOISE / GRAIN */
.tool-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.18;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 1;
}

.tool-card > * {
    position: relative;
    z-index: 3;
}

/* accessibility reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tool-card::before {
        animation: none !important;
    }
}

/* ICON STYLES */
.tool-card .icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    color: #FFD700 !important;
    fill: currentColor;
    stroke: none;
    transition: transform 0.2s ease;
}

.tool-card:hover .icon {
    transform: scale(1.05);
}

/* SVG icon gold override */
.tool-card svg.icon-gold,
.tool-card svg.icon-p {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.tool-card h3 {
    width: 100%;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #ffffff;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: center;
    margin: 0 0 8px 0;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 600;
}

.tool-card p {
    width: 100%;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: rgba(255, 255, 255, 0.75);
    padding: 0 10px;
    margin: 0;
    box-sizing: border-box;
    text-align: center;
    height: auto;
    min-height: 0;
    flex-grow: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* RESPONSIVE FINE-TUNING */
@media (max-width: 768px) {
    .tool-card h3 {
        font-size: clamp(0.85rem, 2vw, 1rem);
        padding: 0 5px;
        width: 100%;
        box-sizing: border-box;
    }
    .tool-card p {
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
        padding: 0 5px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* article section about tools */
.category-article {
    background: #ffffff;
    border-radius: 32px;
    padding: 2.4rem 2.2rem;
    margin: 2rem 0 2rem;
    box-shadow: 0 18px 35px -15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.03);
}

.article-title {
    font-size: 1.9rem;
    font-weight: 700;
    background: linear-gradient(120deg, #1F2A48, #2A3A6C);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}

.article-text {
    color: #2c3e4f;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.article-text h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1F2A48;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-text hr {
    margin: 1.8rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e4ec, transparent);
}

.insight-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin-top: 1.2rem;
}

.insight-badge {
    background: #f0f2fa;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f2b48;
}

/* view all button */
.view-all-wrapper {
    text-align: center;
    margin: 1rem 0 2.5rem;
}

.view-all-btn {
    display: inline-block;
    background: var(--gradient-pink);
    color: white;
    padding: 12px 34px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 14px rgba(255, 51, 102, 0.25);
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px rgba(255, 51, 102, 0.35);
    color: white;
}

/* ensure entire card is clickable and no extra button */
.tool-card .tool-action {
    display: none;
}
