/* ============================= */
/*         SERVICES STYLES        */
/* ============================= */

/* Fix text colors - dark text on light backgrounds */
.page-servizi p, .page-servizi li, .page-servizi span {
    color: #1F2937 !important;
}

.service-card p, .service-card li {
    color: #1F2937 !important;
}

/* SERVICES GRID */
.services-grid, .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

service-card, .portfolio-item {
    background: transparent;
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.service-card::before, .portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent, #6c63ff), var(--accent-2, #ffdd57));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::before, .portfolio-item:hover::before {
    transform: scaleX(1);
}

.service-card:hover, .portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.service-card h3, .portfolio-item h3 {
    color: #fff;
    margin-top: 0;
    position: relative;
    display: inline-block;
}

.service-card h3::after, .portfolio-item h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-2, #ffdd57);
    transition: width 0.3s ease;
}

.service-card:hover h3::after, .portfolio-item:hover h3::after {
    width: 100%;
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.service-card li {
    padding: 0.25rem 0;
    color: rgba(255, 255, 255, 0.8);
    transform: translateX(0);
    transition: all 0.3s ease;
}

.service-card li:hover {
    transform: translateX(5px);
    color: var(--accent-2);
}

.service-card li:before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.service-card li:hover:before {
    transform: scale(1.2);
    color: var(--accent-2);
}

/* Service icon styling */
.service-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    display: inline-block;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(5deg);
    color: var(--accent-2);
}

/* Service card number indicator */
.service-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.service-card:hover .service-number {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.4);
}

/* Price tag styling */
.service-price {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-2);
}

.service-price span {
    font-size: 0.9rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.6);
}

/* Service features with animation */
.feature-list li {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s ease forwards;
}

.service-card:hover .feature-list li:nth-child(1) { animation-delay: 0.1s; }
.service-card:hover .feature-list li:nth-child(2) { animation-delay: 0.2s; }
.service-card:hover .feature-list li:nth-child(3) { animation-delay: 0.3s; }
.service-card:hover .feature-list li:nth-child(4) { animation-delay: 0.4s; }
.service-card:hover .feature-list li:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA Button in service card */
.service-cta {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.service-card:hover .service-cta {
    opacity: 1;
    transform: translateY(0);
}

.service-cta:hover {
    background: var(--accent-2);
    color: var(--accent);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .services-grid, .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card, .portfolio-item {
        padding: 1.5rem;
    }
    
    .service-card:hover, .portfolio-item:hover {
        transform: translateY(-5px);
    }
    
    /* Fix text overflow on mobile */
    .service-card, .service-card h3, .service-card p, .service-card li,
    .portfolio-item, .portfolio-item h3, .portfolio-item p {
        max-width: 100%;
        overflow: visible;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Fix icon centering */
    .service-icon i, .service-icon svg {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .service-card, .portfolio-item,
    .service-card::before, .portfolio-item::before,
    .service-card li, .portfolio-item li,
    .service-icon,
    .service-number,
    .service-cta {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
