/* ===========================================================
   SERVICES SECTION
   - Cards have COLORED backgrounds
   - Hover: WHITE spotlight follows cursor
   - 3D Liquid Arrows
   - FIXED Mobile Cards
=========================================================== */

.services-section {
    background: #fff;
    padding: 100px 0;
    overflow: hidden;
}

/* ===========================================================
   HEADER
=========================================================== */

.services-header {
    text-align: center;
    padding: 0 24px 60px;
}

.services-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: #111;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3em;
    line-height: 1.2;
}

.title-static {
    color: #111;
}

.title-rotating {
    position: relative;
    display: inline-flex;
    overflow: hidden;
    padding: 0.1em 0.4em;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 12px;
    min-width: 200px;
    justify-content: center;
}

.rotating-word {
    position: absolute;
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
}

.rotating-word:first-child {
    position: relative;
}

.services-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: #666;
    margin: 0;
}

/* ===========================================================
   GRID - Desktop
=========================================================== */

.services-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ===========================================================
   SERVICE CARD - Colored Background
=========================================================== */

.service-card {
    --mouse-x: 50%;
    --mouse-y: 50%;
    
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.service-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ===========================================================
   WHITE SPOTLIGHT - Follows Cursor
=========================================================== */

.card-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
        350px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.7) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
}

.service-card:hover .card-spotlight {
    opacity: 1;
}

/* ===========================================================
   CARD CONTENT
=========================================================== */

.card-content {
    position: relative;
    z-index: 2;
    padding: 36px 32px 90px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-icon svg {
    width: 26px;
    height: 26px;
    color: var(--card-color);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
    flex: 1;
}

/* ===========================================================
   3D LIQUID ARROW
=========================================================== */

.card-arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    text-decoration: none;
}

.arrow-sphere {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.arrow-sphere:hover {
    transform: scale(1.12);
}

.arrow-gradient {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--card-color), var(--card-dark) 50%, var(--card-darker));
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 -3px 12px rgba(0, 0, 0, 0.2),
        inset 0 3px 12px rgba(255, 255, 255, 0.25);
}

.arrow-sphere:hover .arrow-gradient {
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 16px 48px rgba(0, 0, 0, 0.15),
        inset 0 -3px 12px rgba(0, 0, 0, 0.25),
        inset 0 3px 12px rgba(255, 255, 255, 0.3);
}

.arrow-shine {
    position: absolute;
    top: 5px;
    left: 9px;
    width: 22px;
    height: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.15));
    border-radius: 50%;
    filter: blur(1px);
    z-index: 1;
}

.arrow-sphere svg {
    position: relative;
    z-index: 2;
    width: 22px;
    height: 22px;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.arrow-sphere:hover svg {
    transform: translate(3px, -3px);
}

/* ===========================================================
   CTA CARD - Dark Theme
=========================================================== */

.card-cta {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.card-cta .card-spotlight {
    background: radial-gradient(
        350px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.06) 30%,
        transparent 60%
    );
}

.card-cta:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.card-cta .card-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-cta .card-icon svg {
    color: #fff;
}

.card-cta .card-title {
    color: #fff;
}

.card-cta .card-desc {
    color: rgba(255, 255, 255, 0.6);
}

.card-arrow-light .arrow-gradient {
    background: linear-gradient(145deg, #fff, #e2e8f0 50%, #cbd5e1);
    box-shadow: 
        0 4px 16px rgba(255, 255, 255, 0.2),
        0 8px 32px rgba(255, 255, 255, 0.1),
        inset 0 -3px 12px rgba(0, 0, 0, 0.08),
        inset 0 3px 12px rgba(255, 255, 255, 0.9);
}

.card-arrow-light .arrow-sphere:hover .arrow-gradient {
    box-shadow: 
        0 8px 24px rgba(255, 255, 255, 0.3),
        0 16px 48px rgba(255, 255, 255, 0.15),
        inset 0 -3px 12px rgba(0, 0, 0, 0.1),
        inset 0 3px 12px rgba(255, 255, 255, 1);
}

.card-arrow-light svg {
    color: #0f172a;
    filter: none;
}

/* ===========================================================
   VIEW MORE BUTTON
=========================================================== */

.services-more {
    display: none;
    padding: 28px 16px 0;
}

.btn-gradient {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-gradient:hover {
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-gradient svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-gradient.expanded svg {
    transform: rotate(180deg);
}

.btn-gradient.expanded .btn-text {
    font-size: 0;
}

.btn-gradient.expanded .btn-text::after {
    content: 'Show Less';
    font-size: 15px;
}

/* ===========================================================
   RESPONSIVE - Tablet (1024px)
=========================================================== */

@media (max-width: 1024px) {
    .services-section {
        padding: 80px 0;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .card-content {
        padding: 32px 28px 80px;
        min-height: 280px;
    }
    
    .arrow-sphere {
        width: 50px;
        height: 50px;
    }
    
    .arrow-sphere svg {
        width: 20px;
        height: 20px;
    }
}

/* ===========================================================
   RESPONSIVE - Mobile (768px) - FIXED CARDS
=========================================================== */

@media (max-width: 768px) {
    .services-section {
        padding: 60px 0;
    }
    
    .services-header {
        padding: 0 16px 40px;
    }
    
    .title-rotating {
        min-width: 140px;
        border-radius: 8px;
    }
    
    .services-container {
        padding: 0;
    }
    
    /* Horizontal Scroll Cards */
    .services-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 16px;
        padding: 10px 16px 20px;
        gap: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .services-grid::-webkit-scrollbar {
        display: none;
    }
    
    /* FIXED: Card Shape on Mobile */
    .service-card {
        flex: 0 0 85%;
        min-width: 85%;
        max-width: 85%;
        width: 85%;
        scroll-snap-align: start;
        border-radius: 20px;
        min-height: auto;
        height: auto;
    }
    
    .card-content {
        padding: 28px 24px 75px;
        min-height: 260px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        border-radius: 14px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-desc {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .card-arrow {
        bottom: 20px;
        right: 20px;
    }
    
    .arrow-sphere {
        width: 46px;
        height: 46px;
    }
    
    .arrow-sphere svg {
        width: 18px;
        height: 18px;
    }
    
    .arrow-shine {
        width: 18px;
        height: 10px;
        top: 4px;
        left: 7px;
    }
    
    /* Show View More Button */
    .services-more {
        display: block;
    }
    
    /* Expanded State - Vertical Stack */
    .services-grid.expanded {
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    .services-grid.expanded .service-card {
        flex: 0 0 100%;
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        margin-bottom: 16px;
    }
    
    .services-grid.expanded .service-card:last-child {
        margin-bottom: 0;
    }
}

/* ===========================================================
   RESPONSIVE - Small Mobile (480px)
=========================================================== */

@media (max-width: 480px) {
    .services-title {
        flex-direction: column;
        gap: 0.2em;
    }
    
    .title-rotating {
        min-width: 120px;
    }
    
    .service-card {
        flex: 0 0 90%;
        min-width: 90%;
        max-width: 90%;
        width: 90%;
    }
    
    .card-content {
        padding: 24px 20px 70px;
        min-height: 240px;
    }
    
    .card-icon {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        border-radius: 12px;
    }
    
    .card-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-desc {
        font-size: 0.85rem;
    }
    
    .arrow-sphere {
        width: 42px;
        height: 42px;
    }
    
    .arrow-sphere svg {
        width: 16px;
        height: 16px;
    }
    
    .arrow-shine {
        width: 16px;
        height: 8px;
        top: 4px;
        left: 6px;
    }
}

/* ===========================================================
   REDUCED MOTION
=========================================================== */

@media (prefers-reduced-motion: reduce) {
    .arrow-sphere:hover {
        transform: none !important;
    }
}