/* ========================================
   Browse Topics Section - Grid Pulse Effect
   ======================================== */

.browse-topics-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #5b9bd5 0%, #5b9bd5 100%);
    position: relative;
    overflow: hidden;
}

/* Grid background pattern */
.browse-topics-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

/* Subtle moving highlight */
.browse-topics-section::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
            circle at 30% 40%,
            rgba(168, 213, 245, 0.08) 0%,
            transparent 40%
        ),
        radial-gradient(
            circle at 70% 70%,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 40%
        );
    animation: moveBackground 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes moveBackground {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

/* Pulse Container */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Square pulse effect - starts from card border and expands outward */
.water-ripple {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    pointer-events: none;
    animation: squarePulse 2.5s ease-out forwards;
}

@keyframes squarePulse {
    0% {
        opacity: 1;
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.7);
        margin: 0;
    }
    40% {
        opacity: 0.4;
        border-color: rgba(168, 213, 245, 0.4);
    }
    100% {
        opacity: 0;
        border-width: 1px;
        border-color: rgba(168, 213, 245, 0);
        margin: -200px;
        padding: 200px;
    }
}

/* Section content */
.browse-topics-section .container {
    position: relative;
    z-index: 10;
}

.browse-topics-section .section-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.browse-topics-section .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
}

.browse-topics-section .title-underline {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    margin: 0 auto 30px;
    border-radius: 0;
}

.browse-topics-section .section-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
}

/* Topic Card */
.topic-card {
    display: block;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    padding: 40px 25px;
    text-align: center;
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 220px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 100;
}

/* Corner bracket accents */
.topic-card::before,
.topic-card::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: rgba(255, 255, 255, 0.3);
    border-style: solid;
    transition: all 0.4s ease;
    z-index: 0;
}

.topic-card::before {
    top: 10px;
    left: 10px;
    border-width: 2px 0 0 2px;
}

.topic-card::after {
    bottom: 10px;
    right: 10px;
    border-width: 0 2px 2px 0;
}

.topic-card:hover::before,
.topic-card:hover::after {
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Card hover */
.topic-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Topic Icon */
.topic-icon {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.topic-card:hover .topic-icon {
    background: #ffffff;
    border-color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.topic-icon i {
    font-size: 2.2rem;
    color: #ffffff;
    transition: color 0.4s ease;
}

.topic-card:hover .topic-icon i {
    color: #5b9bd5;
}

/* Topic Title */
.topic-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.topic-card:hover .topic-title {
    color: #ffffff;
}

/* Topic Count */
.topic-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
    position: relative;
    z-index: 1;
}

.topic-card:hover .topic-count {
    color: rgba(255, 255, 255, 0.95);
}

/* Responsive */
@media (max-width: 991px) {
    .browse-topics-section {
        padding: 80px 0;
    }

    .browse-topics-section .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .topic-card {
        padding: 30px 20px;
        min-height: 200px;
    }

    .topic-icon {
        width: 64px;
        height: 64px;
    }

    .topic-icon i {
        font-size: 1.8rem;
    }

    .topic-title {
        font-size: 1.1rem;
    }

    .browse-topics-section .section-title {
        font-size: 1.75rem;
    }

    /* Smaller pulses on mobile */
    @keyframes squarePulse {
        0% {
            width: 0;
            height: 0;
            opacity: 1;
            border-width: 2px;
            border-color: rgba(255, 255, 255, 0.7);
        }
        40% {
            opacity: 0.5;
        }
        100% {
            width: 500px;
            height: 500px;
            opacity: 0;
            border-width: 1px;
            border-color: rgba(168, 213, 245, 0);
        }
    }
}
