/* ============================================
   Service Card Grid + Section Reveal System
   ============================================ */

/* All service form sections start hidden — revealed via card click */
.service-section { display: none; }
.service-section.active {
    display: block;
    animation: serviceReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes serviceReveal {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* "Wapas overview" button at top of revealed section */
.service-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.service-back:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateX(-3px);
}

/* ---- Hero section: header for service grid ---- */
.services-section {
    padding: 60px 0 80px;
    position: relative;
}
.services-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 50px;
}
.services-header h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(28px, 4.5vw, 44px);
    background: linear-gradient(90deg, #c084fc 0%, #f0abfc 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 14px;
    line-height: 1.2;
}
.services-header p {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ---- Card grid ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.service-card {
    --mx: 50%;
    --my: 50%;
    --grad-from: #8b5cf6;
    --grad-to: #ec4899;
    position: relative;
    background: rgba(20, 20, 35, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 22px;
    padding: 30px 26px;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s,
                box-shadow 0.4s;
    isolation: isolate;
}

/* Soft radial highlight that follows the cursor */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mx) var(--my),
        rgba(139, 92, 246, 0.22),
        transparent 55%
    );
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    pointer-events: none;
}

/* Animated gradient border that pulses on hover */
.service-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to), var(--grad-from));
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    animation: gradMove 4s linear infinite;
    z-index: -1;
}
@keyframes gradMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: transparent;
    box-shadow:
        0 20px 60px -10px rgba(139, 92, 246, 0.35),
        0 0 0 1px rgba(139, 92, 246, 0.5);
}
.service-card:hover::before { opacity: 1; }
.service-card:hover::after  { opacity: 1; }

.service-card:active { transform: translateY(-4px) scale(0.985); }

/* Per-tag gradient color */
.service-card.tag-kundli   { --grad-from: #8b5cf6; --grad-to: #ec4899; }
.service-card.tag-numerology { --grad-from: #06b6d4; --grad-to: #8b5cf6; }
.service-card.tag-ai       { --grad-from: #ec4899; --grad-to: #f59e0b; }
.service-card.tag-match    { --grad-from: #ef4444; --grad-to: #ec4899; }
.service-card.tag-compat   { --grad-from: #10b981; --grad-to: #06b6d4; }
.service-card.tag-rashifal { --grad-from: #f59e0b; --grad-to: #ef4444; }
.service-card.tag-name     { --grad-from: #8b5cf6; --grad-to: #06b6d4; }
.service-card.tag-tools    { --grad-from: #6366f1; --grad-to: #ec4899; }

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px -6px var(--grad-from);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-card:hover .service-icon {
    transform: rotate(-6deg) scale(1.08);
}

.service-title {
    font-family: 'Cinzel', serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.service-desc {
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    transition: gap 0.25s;
}
.service-card:hover .service-cta {
    gap: 12px;
}

.service-popular {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(90deg, #fbbf24, #ec4899);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 5px 11px;
    border-radius: 14px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px -2px rgba(251, 191, 36, 0.5);
    z-index: 1;
}

/* Light theme adjustments */
body.light-theme .service-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(139, 92, 246, 0.2);
}
body.light-theme .service-back {
    background: rgba(139, 92, 246, 0.08);
    color: #6d28d9;
}

@media (max-width: 600px) {
    .services-grid { gap: 14px; }
    .service-card { padding: 24px 20px; }
    .service-icon { width: 52px; height: 52px; font-size: 22px; }
}
