/* Categories Showcase Component */
.underline-decor {
    position: relative;
}
.underline-decor img{
     position: absolute;
     top: 0;
     left: 50%;
     transform: translateX(-50%);
     height: 30px;

}

.underline-decor::after{
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    content: '';
    width: 40%;
    height: 4px;
    border-radius: 100%;
    background: #337070cf;
    z-index: -1;
}

.categories-showcase-wrapper {
    width: 100%;
    padding: 40px 20px;
    direction: rtl;
}

.categories-title {
    text-align: center;
    margin-bottom: 40px;
}

.categories-title h2 {
    font-size: 2.5rem;
    color: var(--color1);
    margin: 0;
    font-weight: 700;
}

.book-container {
    width: 80%;
    aspect-ratio: 1.6;
    border-radius: 16px;
    position: relative;
    border: 2px solid var(--color1);
    background: url("https://daralzad.com/islamic-pattern-background/");
    background-size: 500px;
    box-shadow: inset 0 0 40px rgba(67, 179, 174, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.08);
    z-index: 0;
    margin: 0 auto;
    overflow: hidden;
}

.book-container::after {
    content: '';
    width: 300px;
    height: 8px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 4px);
    background: var(--background);
    pointer-events: none;
    z-index: 2;
}

 
.book-svg {
    position: absolute;
    background: radial-gradient(
    circle at bottom center,
    var(--background) 10%,
    rgba(0,0,0,0) 70%);
    width: 300px;
    height: fit-content;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 0%);
    z-index: 3;
    margin-bottom: -4px;
    pointer-events: none;
 }
.book-svg path {
    fill: var(--color1);
    stroke: var(--color1);
}
.cat-frame {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    align-items: center;
    justify-items: center;
    position: absolute;
    width: 100%;
    height: 90%;
    z-index: 5;
    gap: 10px;
    padding: 20px;
}

.cat-item {
    text-decoration: none !important;
    display: flex;
    justify-content: center;
    height: 50%;
    aspect-ratio:1.6;
 }

.cat-item-title {
    font-size: 1.8rem;
    width:100%;
    height:100%;
    color: var(--color5);
    font-weight: 700;
    border: 4px solid var(--color1);
    padding: 10px 20px;
    border-radius: 25px;
    background: color-mix(in srgb, var(--color1) 90%, transparent);
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    nimation: subtle-float 8s ease-in-out infinite;
}

.cat-item-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgb(201 168 106 / 38%),
            transparent);
    transition: left 0.6s ease;
}

.cat-item:hover .cat-item-title {
    background: var(--color5);
    color: var(--color1);
    transform: translateY(-5px) scale(1.05);
    border-color: var(--color1);
    z-index: 10;
}

.cat-item:hover .cat-item-title::before {
    left: 100%;
}

.cat-item-title:hover {
    filter:brightness(1.08) drop-shadow(0 0 8px rgba(67, 179, 174, 0.5))
}

/* Stagger animations */
.cat-item-1 { animation-delay: 0s; }
.cat-item-2 { animation-delay: 0.4s; }
.cat-item-3 { animation-delay: 0.8s; }
.cat-item-4 { animation-delay: 1.2s; }
.cat-item-5 { animation-delay: 1.6s; }
.cat-item-6 { animation-delay: 2s; }
.cat-item-7 { animation-delay: 2.4s; }
.cat-item-8 { animation-delay: 2.8s; }
.cat-item-9 { animation-delay: 3.2s; }

@keyframes subtle-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .categories-showcase-wrapper {
        padding: 30px 15px;
    }

    .categories-title h2 {
        font-size: 1.8rem;
    }

    .book-container {
        aspect-ratio: 1.4;
    }

    .cat-item-title {
        font-size: 1.4rem;
        padding: 8px 15px;
        min-width: 90px;
        min-height: 55px;
    }

    .cat-frame {
        gap: 5px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .categories-showcase-wrapper {
        padding: 20px 10px;
    }

    .categories-title h2 {
        font-size: 1.4rem;
    }

    .book-container {
        aspect-ratio: 1.2;
    }

    .cat-item-title {
        font-size: 1rem;
        padding: 6px 12px;
        min-width: 70px;
        min-height: 45px;
    }

    .cat-frame {
        gap: 3px;
        padding: 10px;
    }
}
