/* ========================================
   CLEAN CATEGORIES SECTION STYLES
   Premium Motion & Aesthetics
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    /* Slightly better contrast */
    padding: 0;
}

/* Container */
.container-clean {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Category Section */
.category-section-clean {
    padding: 4rem 0;
    margin-top: 20px;
    position: relative;
    /* Removed overflow: hidden so particles can fly out */
    overflow: visible;
}

/* Section Header */
.section-header-clean {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title-clean {
    font-size: 2rem;
    font-weight: 800;
    color: #1F2937;
    letter-spacing: -0.03em;
    position: relative;
    display: inline-block;
}

.section-title-clean::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Category Grid */
.category-grid-clean {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* ========================================
   MAGICAL CARD STYLES
   ======================================== */

.category-card-clean {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: row;
    /* Side-by-side layout: Icon Left, Text Right */
    align-items: center;
    /* Center items vertically */
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(226, 232, 240, 0.8);

    /* 3D & Depth Properties */
    transform-style: preserve-3d;
    perspective: 1000px;

    /* Init State */
    transform: translateY(0);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.02),
        0 2px 4px -1px rgba(0, 0, 0, 0.02);

    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        border-color 0.3s ease;

    z-index: 1;
    isolation: isolate;
    overflow: visible;
}

/* 2. The Internal Shine/Sweep (Overlay) */
.category-card-clean::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 70%);
    background-size: 200% 100%;
    background-position: -100% 0;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: opacity 0.3s;
}

/* ========================================
   HOVER INTERACTIONS
   ======================================== */

.category-card-clean:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 30px -5px rgba(0, 0, 0, 0.06),
        0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.category-card-clean:hover::after {
    opacity: 1;
    animation: shine-sweep 1s ease-out forwards;
}

/* Active/Focus States */
.category-card-clean:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.5);
    transform: translateY(-5px);
}

/* Content Styling */
.category-icon-clean {
    position: relative;
    width: 60px;
    /* Optimal size for side-by-side */
    height: 60px;
    min-width: 60px;
    /* Prevent shrinking */
    border-radius: 16px;
    /* Slightly more rounded square */
    background: #f1f5f9;

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #475569;
    transition: all 0.4s ease;
    z-index: 2;

    /* Subtle inner dimensionality */
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
}

/* Trigger Icon Styles on Card Hover */
.category-card-clean:hover .category-icon-clean {
    background: #ffffff;
    color: #6366f1;

    /* GLOW AS BOX SHADOW ONLY */
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.3),
        0 4px 6px -1px rgba(99, 102, 241, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 1);
}

/* === MAGIC PARTICLE EMITTER === */
.category-card-clean:hover .category-icon-clean::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: transparent;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    animation: particle-explosion 2s ease-out forwards;
}

@keyframes particle-explosion {
    0% {
        box-shadow:
            0 0 0 0px rgba(99, 102, 241, 0.8),
            0 0 0 0px rgba(168, 85, 247, 0.8),
            0 0 0 0px rgba(56, 189, 248, 0.8),
            0 0 0 0px rgba(99, 102, 241, 0.8),
            0 0 0 0px rgba(168, 85, 247, 0.8),
            0 0 0 0px rgba(56, 189, 248, 0.8);
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        box-shadow:
            -40px -50px 0 0px rgba(99, 102, 241, 0),
            40px -50px 0 0px rgba(168, 85, 247, 0),
            -50px 20px 0 0px rgba(56, 189, 248, 0),
            50px 20px 0 0px rgba(99, 102, 241, 0),
            -20px 60px 0 0px rgba(168, 85, 247, 0),
            20px 60px 0 0px rgba(56, 189, 248, 0);
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.category-text-clean {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align text */
    text-align: left;
    gap: 0.25rem;
    /* Tighter gap for better grouping */
    width: 100%;
}

.category-text-clean h3 {
    font-size: 1.1rem;
    /* Balanced size */
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.category-card-clean:hover .category-text-clean h3 {
    color: #0A2E6E;
}

.category-text-clean p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
    max-width: 100%;
    /* Utilize full width */
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes shine-sweep {
    0% {
        background-position: 150% 0;
    }

    100% {
        background-position: -50% 0;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .category-grid-clean {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

}

@media (max-width: 768px) {
    .category-grid-clean {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .category-card-clean {
        padding: 1.5rem;
    }

    /* Reduce motion on mobile slightly */
    .category-card-clean:hover {
        transform: translateY(-5px);
    }
  
}

@media (max-width: 480px) {
    .category-grid-clean {
        grid-template-columns: 1fr;
    }
     .section-title-clean{
        margin-top: 70px;
    }
}

/* Reduced Motion Pref */
@media (prefers-reduced-motion: reduce) {

    .category-card-clean,
    .category-card-clean::before,
    .category-card-clean::after {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .category-card-clean:hover {
        border-color: #6366f1;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}