@import "css/styles.css";

.services {
    padding: 2rem 2rem 4rem 2rem;
    background: linear-gradient(180deg, #f5f5f5 0%, #ffffff 50%, #f5f5f5 100%);
    position: relative;
    overflow: hidden;
    scroll-margin-top: 20px;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            radial-gradient(circle at 20% 30%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgba(255, 140, 66, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

.services-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

/* Neomorphic Service Card with Glassmorphism */
.service-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 3rem 2.5rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);

    /* Neomorphic shadows */
    box-shadow:
            12px 12px 24px rgba(34, 34, 128, 0.2),
            -8px -12px 24px rgba(255, 255, 255, 0.8),
            inset 0 0 0 rgba(255, 255, 255, 0);
}

/* Gradient overlay */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
    rgba(255, 107, 53, 0.05) 0%,
    rgba(255, 140, 66, 0.08) 50%,
    rgba(255, 167, 38, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 30px;
}

/* Animated border glow */
.service-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
    var(--primary-color),
    var(--secondary-color),
    var(--accent-color),
    var(--primary-color));
    background-size: 300% 300%;
    border-radius: 30px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: gradientRotate 3s ease infinite;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 0.6;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);

    /* Enhanced glassmorphism on hover */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);

    /* Inverted neomorphic effect */
    box-shadow:
            20px 20px 40px rgba(174, 174, 192, 0.3),
            -20px -20px 40px rgba(255, 255, 255, 1),
            inset 2px 2px 5px rgba(255, 255, 255, 0.5),
            inset -2px -2px 5px rgba(174, 174, 192, 0.1);
}

/* Service Icon with Advanced Effects */
.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    position: relative;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Neomorphic icon background */
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    box-shadow:
            8px 8px 16px rgba(174, 174, 192, 0.4),
            -8px -8px 16px rgba(255, 255, 255, 0.9);

    color: var(--primary-color);
}

/* Icon inner glow */
.service-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: radial-gradient(circle,
    rgba(255, 107, 53, 0.3) 0%,
    transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.6s ease;
}

/* Rotating ring effect */
.service-icon::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 22px;
    background: linear-gradient(45deg,
    var(--primary-color),
    var(--secondary-color),
    var(--accent-color),
    var(--primary-color));
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: all 0.6s ease;
    animation: gradientRotate 2s linear infinite;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotateY(360deg);

    /* Inverted shadows - pressed in effect */
    box-shadow:
            inset 6px 6px 12px rgba(174, 174, 192, 0.4),
            inset -6px -6px 12px rgba(255, 255, 255, 0.9);

    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.service-card:hover .service-icon::before {
    opacity: 1;
    width: 100%;
    height: 100%;
}

.service-card:hover .service-icon::after {
    opacity: 1;
    animation: gradientRotate 1.5s linear infinite;
}

.service-icon i {
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
}

.service-card:hover .service-icon i {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Service Card Content */
.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    text-align: center;
}

.service-card:hover h3 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateY(-3px);
}

.service-card p {
    color: var(--text-light);
    line-height: 1.8;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    text-align: center;
}

.service-card:hover p {
    color: var(--text-dark);
    transform: translateY(-2px);
}

/* Floating particles effect on hover */
.service-card:hover {
    animation: cardFloat 3s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(-15px) scale(1.02);
    }
    50% {
        transform: translateY(-20px) scale(1.02);
    }
}

/* Staggered animation for cards */
.service-card:nth-child(1) {
    animation-delay: 0s;
}

.service-card:nth-child(2) {
    animation-delay: 0.1s;
}

.service-card:nth-child(3) {
    animation-delay: 0.2s;
}

.service-card:nth-child(4) {
    animation-delay: 0.3s;
}

.service-card:nth-child(5) {
    animation-delay: 0.4s;
}

.service-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* Light beam effect */
.service-card:hover::before {
    animation: lightSweep 2s ease-in-out infinite;
}

@keyframes lightSweep {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}


@media (max-width: 1024px) {
    .services {
        padding: 5rem 1.5rem 3rem 1.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .service-card {
        padding: 2.5rem 2rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .services {
        padding: 4rem 1.25rem 2.5rem 1.25rem;
        scroll-margin-top: 30px;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .section-header h2 {
        font-size: 2.25rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        max-width: 500px;
    }

    .service-card {
        padding: 2.25rem 1.75rem;
        border-radius: 24px;

        /* Simplified shadows for mobile performance */
        box-shadow:
                8px 8px 16px rgba(34, 34, 128, 0.15),
                -6px -6px 16px rgba(255, 255, 255, 0.8);
    }

    /* Disable complex hover effects on mobile */
    .service-card:hover {
        transform: translateY(-8px) scale(1.01);
    }

    /* Simplified icon for mobile */
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .service-card:hover .service-icon {
        transform: scale(1.1);
    }

    .service-card h3 {
        font-size: 1.35rem;
    }

    .service-card p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .services {
        padding: 3.5rem 1rem 2rem 1rem;
        scroll-margin-top: 65px;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .section-header p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .services-grid {
        gap: 1.5rem;
        max-width: 100%;
    }

    .service-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;

        /* Even more simplified for small mobile */
        box-shadow:
                6px 6px 12px rgba(34, 34, 128, 0.12),
                -4px -4px 12px rgba(255, 255, 255, 0.8);
    }

    /* Minimal hover effect on small mobile */
    .service-card:hover {
        transform: translateY(-5px);
    }

    .service-card::after {
        display: none; /* Remove animated border on small screens */
    }

    .service-icon {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
        border-radius: 16px;
    }

    /* Remove complex animations on small mobile for performance */
    .service-icon::after {
        display: none;
    }

    .service-card:hover .service-icon {
        transform: scale(1.08);
        animation: none;
    }

    .service-card:hover .service-icon i {
        animation: none;
    }

    .service-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .service-card p {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    /* Remove floating animation on small screens */
    .service-card:hover {
        animation: none;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .services {
        padding: 3rem 0.75rem 1.75rem 0.75rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    .service-card {
        padding: 1.75rem 1.25rem;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.65rem;
    }

    .service-card h3 {
        font-size: 1.15rem;
    }

    .service-card p {
        font-size: 0.875rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .service-card {
        /* Remove hover-dependent effects on touch devices */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .service-card:active {
        transform: scale(0.98);
    }

    /* Simplify icon interactions for touch */
    .service-icon {
        transition: transform 0.3s ease;
    }

    .service-card:active .service-icon {
        transform: scale(0.95);
    }
}