/**
 * ServicesGridComponent CSS
 * Stili per il componente griglia servizi con design moderno e overlapping cards
 */

:root {
    --service-primary: #00ff9d;
    --service-secondary: #4c3d8a;
    --service-light: #f7fafc;
    --dark-bg: #0a0a0a;
    --text-dark: #2d3748;
    --text-light: #4a5568;
}

.services-section {
    padding: 80px 0;
    position: relative;
    min-height: 50vh;
    color: white;
}

.section-title {
    color: var(--service-primary);
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 60px;
    text-align: left;
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
    position: relative;
}

.section-title::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--service-primary);
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    margin-left: 20px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.services-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.service-item {
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: -20px; /* Aumentato spazio: da -50px a -20px */
    
    /* Colori dinamici tramite CSS custom properties */
    background: linear-gradient(135deg, var(--card-bg-color, var(--service-primary)) 0%, color-mix(in srgb, var(--card-bg-color, var(--service-primary)) 80%, black 20%) 100%);
    color: var(--card-text-color, white);
}

.service-item:nth-child(1) { z-index: 1; }
.service-item:nth-child(2) { z-index: 2; }
.service-item:nth-child(3) { z-index: 3; }
.service-item:last-child { margin-bottom: 0; }

.service-item.expanded {
    z-index: 10;
    margin-bottom: 30px;
    transform: translateY(-10px) scale(1.02);
}

.service-item:hover:not(.expanded) {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px var(--card-bg-color, var(--service-primary));
}

.service-header {
    display: flex;
    align-items: center;
    padding: 40px;
    position: relative;
    min-height: 140px;
}

.service-title {
    flex: 0 0 300px;
    font-size: 2.2rem;
    font-weight: bold;
    line-height: 1.2;
    margin-right: 40px;
}

.service-preview {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.service-arrow {
    flex: 0 0 50px;
    text-align: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.service-item.expanded .service-arrow {
    transform: rotate(45deg);
}

.service-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(0, 0, 0, 0.1);
}

.service-item.expanded .service-content {
    max-height: 2000px; /* Valore alto per contenere tutto il contenuto */
    transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-content-inner {
    padding: 0 40px 40px 40px;
}

.service-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.service-item.light .feature-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.service-item.light .feature-icon {
    color: var(--text-dark);
}

.feature-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.feature-description {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.5;
}

.portfolio-button {
    background: linear-gradient(135deg, var(--service-secondary) 0%, #6b5b95 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 50px auto 0;
    display: block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(76, 61, 138, 0.3);
}

.portfolio-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.portfolio-button:hover::before {
    left: 100%;
}

.portfolio-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 35px rgba(76, 61, 138, 0.4),
        0 0 25px rgba(0, 255, 157, 0.2);
}

.pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    background: var(--service-primary);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s infinite linear;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { width: 7px; height: 7px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 0.5s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 2.5s; }

@keyframes float {
    0% { 
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.1; }
    90% { opacity: 0.1; }
    100% { 
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        text-align: center;
        margin-bottom: 40px;
    }

    .service-item {
        margin-bottom: -20px;
    }

    .service-item.expanded {
        transform: translateY(-5px) scale(1.01);
        margin-bottom: 20px;
    }

    .service-header {
        flex-direction: column;
        text-align: center;
        padding: 30px 25px;
        min-height: auto;
    }

    .service-title {
        flex: none;
        margin-right: 0;
        margin-bottom: 20px;
        font-size: 1.8rem;
    }

    .service-preview {
        margin-bottom: 20px;
        font-size: 1rem;
    }

    .service-content-inner {
        padding: 0 25px 30px 25px;
    }

    .service-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-item {
        padding: 20px;
    }

    .portfolio-button {
        padding: 15px 40px;
        font-size: 1.1rem;
        margin-top: 40px;
    }
}

/* Supporto per colori dinamici */
.services-section[data-primary-color] {
    --service-primary: attr(data-primary-color);
}

.services-section[data-secondary-color] {
    --service-secondary: attr(data-secondary-color);
}

.services-section[data-light-color] {
    --service-light: attr(data-light-color);
}

/* Stili per contenuto markdown nelle card */
.service-markdown-content {
    padding: 20px 0;
    line-height: 1.6;
}

.service-markdown-content h1,
.service-markdown-content h2,
.service-markdown-content h3,
.service-markdown-content h4,
.service-markdown-content h5,
.service-markdown-content h6 {
    color: inherit;
    margin: 20px 0 15px 0;
    font-weight: bold;
}

.service-markdown-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.service-markdown-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
}

.service-markdown-content h3 {
    font-size: 1.3rem;
    color: var(--st-white);
}

.service-markdown-content p {
    margin: 15px 0;
    opacity: 0.9;
}

.service-markdown-content ul,
.service-markdown-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.service-markdown-content li {
    margin: 8px 0;
    opacity: 0.9;
    color: var(--st-white);
}

.service-markdown-content strong {
    font-weight: bold;
    opacity: 1;
}

.service-markdown-content em {
    font-style: italic;
}

.service-markdown-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.service-markdown-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.service-markdown-content blockquote {
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    opacity: 0.8;
}

.service-markdown-content table,
.service-markdown-content .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.service-markdown-content th,
.service-markdown-content td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.service-markdown-content th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.service-markdown-content td {
    background: rgba(255, 255, 255, 0.02);
    transition: background-color 0.2s ease;
}

/* Testo celle tabella più chiaro (prima risultava troppo grigio) */
.service-item:not(.light) .service-markdown-content td,
.service-item:not(.light) .service-markdown-content th {
    color: rgba(255, 255, 255, 0.92);
}

/* Rafforza il colore dei link dentro le celle */
.service-item:not(.light) .service-markdown-content td a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
}

/* Migliora la visualizzazione dei badge multipli nelle card */
.service-markdown-content .badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-markdown-content .badges-container .badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--st-text-secondary);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s ease;
}

.service-markdown-content .badges-container .badge:hover {
    transform: translateY(-1px);
    color: var(--st-text-primary);
    border-color: rgba(var(--st-primary-rgb), 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Badge colorati specifici */
.service-markdown-content .badge.bg-primary { 
    background: rgba(var(--st-primary-rgb), 0.12) !important; 
    border: 1px solid rgba(var(--st-primary-rgb), 0.25) !important;
    color: var(--st-primary-light) !important; 
}
.service-markdown-content .badge.bg-success { 
    background: rgba(80, 200, 120, 0.12) !important; 
    border: 1px solid rgba(80, 200, 120, 0.25) !important;
    color: #50c878 !important; 
}
.service-markdown-content .badge.bg-info { 
    background: rgba(13, 202, 240, 0.12) !important; 
    border: 1px solid rgba(13, 202, 240, 0.25) !important;
    color: #0dcaf0 !important; 
}
.service-markdown-content .badge.bg-warning { 
    background: rgba(255, 193, 7, 0.12) !important; 
    border: 1px solid rgba(255, 193, 7, 0.25) !important;
    color: #ffc107 !important; 
}
.service-markdown-content .badge.bg-secondary { 
    background: rgba(var(--st-secondary-rgb), 0.12) !important; 
    border: 1px solid rgba(var(--st-secondary-rgb), 0.25) !important;
    color: var(--st-secondary-light) !important; 
}

/* === Certification Badges (refactor) === */
.service-markdown-content .certifications-badges {
    display:flex;
    flex-wrap:wrap;
    gap:.65rem .75rem;
    padding:1rem 1.25rem 1.1rem;
    margin:1.25rem 0 1.75rem;
    background:linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border:1px solid rgba(255,255,255,0.15);
    border-radius:14px;
    position:relative;
    overflow:visible;
}
.service-markdown-content .certifications-badges:before {
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    padding:1px; /* border glow */
    background:linear-gradient(120deg, rgba(0,170,255,0.5), rgba(140,90,255,0.45), rgba(0,170,255,0.5));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
            mask-composite:exclude;
    opacity:.55;
    pointer-events:none;
}
.service-markdown-content .cert-badge {
    --cb-bg:rgba(255,255,255,0.09);
    --cb-border:rgba(255,255,255,0.25);
    --cb-text:#fff;
    --cb-shadow:rgba(0,0,0,0.35);
    display:inline-flex;
    align-items:center;
    gap:.4rem;
    font-size:.72rem;
    line-height:1.15;
    font-weight:600;
    letter-spacing:.35px;
    padding:.55rem .85rem .55rem .7rem;
    border:1px solid var(--cb-border);
    border-radius:999px;
    background:var(--cb-bg);
    color:var(--cb-text);
    backdrop-filter:blur(4px) saturate(140%);
    -webkit-backdrop-filter:blur(4px) saturate(140%);
    box-shadow:0 2px 4px -1px var(--cb-shadow),0 4px 12px -2px rgba(0,0,0,0.25),inset 0 0 0 1px rgba(255,255,255,0.05);
    position:relative;
    transition:background .3s ease,border-color .3s ease,transform .25s ease;
}
.service-markdown-content .cert-badge:before {
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    padding:1px;
    background:linear-gradient(130deg, rgba(0,185,255,0.8), rgba(160,110,255,0.85));
    opacity:0;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
            mask-composite:exclude;
    transition:opacity .4s ease;
    pointer-events:none;
}
.service-markdown-content .cert-badge:hover {
    --cb-bg:rgba(255,255,255,0.14);
    --cb-border:rgba(255,255,255,0.5);
    transform:translateY(-2px);
}
.service-markdown-content .cert-badge:hover:before { opacity:.55; }
.service-markdown-content .cert-badge .cert-icon { flex:0 0 auto; display:block; opacity:.95; }
.service-markdown-content .cert-badge .cert-text { white-space:nowrap; }

/* Responsive tweaks */
@media (max-width: 640px){
  .service-markdown-content .cert-badge { font-size:.68rem; padding:.5rem .7rem .5rem .6rem; }
  .service-markdown-content .certifications-badges { gap:.55rem .6rem; }
}

.service-markdown-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.05);
}

.service-markdown-content tr:hover td {
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive table */
@media (max-width: 768px) {
    .service-markdown-content table {
        font-size: 0.85em;
    }
    
    .service-markdown-content th,
    .service-markdown-content td {
        padding: 10px 8px;
    }
}

.service-markdown-content a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.service-markdown-content a:hover {
    opacity: 1;
}

.service-markdown-content p {
    color: var(--st-white);
}

/* Stili specifici per card con colori chiari */
.service-item.light .service-markdown-content h1 {
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

.service-item.light .service-markdown-content code {
    background: rgba(0, 0, 0, 0.1);
}

.service-item.light .service-markdown-content pre {
    background: rgba(0, 0, 0, 0.1);
}

.service-item.light .service-markdown-content blockquote {
    border-left-color: rgba(0, 0, 0, 0.3);
}

.service-item.light .service-markdown-content table,
.service-item.light .service-markdown-content .markdown-table {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.service-item.light .service-markdown-content th {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

.service-item.light .service-markdown-content td {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.service-item.light .service-markdown-content tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.05);
}

.service-item.light .service-markdown-content tr:hover td {
    background: rgba(0, 0, 0, 0.08);
}

/* Stili per tabelle con colori specifici per card colorate */
.service-item.primary .service-markdown-content th {
    background: rgba(0, 255, 157, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.service-item.secondary .service-markdown-content th {
    background: rgba(76, 61, 138, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

.service-item.accent .service-markdown-content th {
    background: rgba(255, 107, 53, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.service-item.info .service-markdown-content th {
    background: rgba(66, 153, 225, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.service-item.success .service-markdown-content th {
    background: rgba(72, 187, 120, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.service-item.warning .service-markdown-content th {
    background: rgba(237, 137, 54, 0.2);
    color: rgba(26, 32, 44, 0.9);
}

.service-item.danger .service-markdown-content th {
    background: rgba(245, 101, 101, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* ========================================
   PULSANTE PORTFOLIO CENTRATO
   ======================================== */

.portfolio-button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    position: relative;
}

.portfolio-button-wrapper .portfolio-button {
    position: relative;
    z-index: 1;
    min-width: 180px;
}

/* Dimensioni responsive per il pulsante portfolio */
@media (max-width: 576px) {
    .portfolio-button-wrapper .portfolio-button {
        min-width: 160px;
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    .portfolio-button-wrapper .portfolio-button {
        min-width: 200px;
        font-size: 1.1rem;
    }
}

/* Animazione speciale per il pulsante portfolio */
.portfolio-button-wrapper .portfolio-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 0 30px rgba(0, 255, 157, 0.8),
        0 0 60px rgba(0, 255, 157, 0.6),
        0 0 90px rgba(0, 255, 157, 0.4);
}

/* === ROTAZIONE AUTOMATICA COLORI CARD === */
/* Sistema automatico di colori diversi per ogni card usando alta specificità CSS */

/* Prima card - Verde primario */
.services-section .service-item:nth-child(1) {
    --card-bg-color: #48bb78;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #ffffff;
}

/* Seconda card - Viola */
.services-section .service-item:nth-child(2) {
    --card-bg-color: #4c3d8a;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #4c3d8a 0%, #6b5b95 100%);
    color: #ffffff;
}

/* Terza card - Arancione */
.services-section .service-item:nth-child(3) {
    --card-bg-color: #ff6b35;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
    color: #ffffff;
}

/* Quarta card - Blu */
.services-section .service-item:nth-child(4) {
    --card-bg-color: #4299e1;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: #ffffff;
}

/* Quinta card - Verde chiaro */
.services-section .service-item:nth-child(5) {
       --card-bg-color: #00ff9d;
    --card-text-color: #1a202c;
    background: linear-gradient(135deg, #00ff9d 0%, #00cc7a 100%);
    color: #1a202c;

}

/* Sesta card - Giallo/Arancione */
.services-section .service-item:nth-child(6) {
    --card-bg-color: #ed8936;
    --card-text-color: #1a202c;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: #1a202c;
}

/* Settima card - Rosso */
.services-section .service-item:nth-child(7) {
    --card-bg-color: #f56565;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: #ffffff;
}

/* Ottava card - Viola chiaro */
.services-section .service-item:nth-child(8) {
    --card-bg-color: #9f7aea;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: #ffffff;
}

/* Nona card - Verde acqua */
.services-section .service-item:nth-child(9) {
    --card-bg-color: #38b2ac;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
    color: #ffffff;
}

/* Decima card - Rosa */
.services-section .service-item:nth-child(10) {
    --card-bg-color: #ed64a6;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%);
    color: #ffffff;
}

/* Per card oltre la decima, ripete il ciclo (solo dall'11° elemento in poi) */
.services-section .service-item:nth-child(n+11):nth-child(10n+1) {
    --card-bg-color: #00ff9d;
    --card-text-color: #1a202c;
    background: linear-gradient(135deg, #00ff9d 0%, #00cc7a 100%);
    color: #1a202c;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+2) {
    --card-bg-color: #4c3d8a;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #4c3d8a 0%, #6b5b95 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+3) {
    --card-bg-color: #ff6b35;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+4) {
    --card-bg-color: #4299e1;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+5) {
    --card-bg-color: #48bb78;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+6) {
    --card-bg-color: #ed8936;
    --card-text-color: #1a202c;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: #1a202c;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+7) {
    --card-bg-color: #f56565;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+8) {
    --card-bg-color: #9f7aea;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+9) {
    --card-bg-color: #38b2ac;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #38b2ac 0%, #319795 100%);
    color: #ffffff;
}

.services-section .service-item:nth-child(n+11):nth-child(10n+10) {
    --card-bg-color: #ed64a6;
    --card-text-color: #ffffff;
    background: linear-gradient(135deg, #ed64a6 0%, #d53f8c 100%);
    color: #ffffff;
}

/* Override per gli elementi espansi - mantiene il colore ma aggiunge effetti */
.services-section .service-item.expanded {
    box-shadow: 
        0 0 30px var(--card-bg-color),
        0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px) scale(1.02);
}

/* === READABILITY & CONTENT STYLING === */
/* Miglioramenti per leggibilità e contrasto del testo nei servizi */
.service-summary-content,
.service-markdown-content {
    color: #ffffff !important;
    line-height: 1.6;
}

.service-summary-content h1,
.service-summary-content h2,
.service-summary-content h3,
.service-summary-content h4,
.service-summary-content h5,
.service-summary-content h6 {
    color: #ffffff !important;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.service-summary-content h2 {
    color: var(--st-primary, #00ff9d) !important;
    font-size: 1.5rem;
    font-weight: 600;
}

.service-summary-content h3 {
    color: var(--st-secondary, #ff6b6b) !important;
    font-size: 1.25rem;
    font-weight: 500;
}

.service-summary-content p {
    color: #ffffff !important;
    margin-bottom: 1rem;
}

.service-summary-content strong {
    color: var(--st-primary, #00ff9d) !important;
    font-weight: 600;
}

.service-summary-content ul,
.service-summary-content ol {
    color: #ffffff !important;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.service-summary-content li {
    color: #ffffff !important;
    margin-bottom: 0.5rem;
    position: relative;
}

.service-summary-content li strong {
    color: var(--st-primary, #00ff9d) !important;
}

/* Evidenziazione prezzi */
.service-summary-content p:contains("Da "),
.service-summary-content strong:contains("€") {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(255, 107, 107, 0.1));
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--st-primary, #00ff9d);
    margin: 1rem 0;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Miglioramento preview/excerpt */
.service-preview {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* ========================================
   FEATURED SERVICES - BANNERINO ELEGANTE
   ======================================== */

/* Servizio Featured - Base con glow sottile */
.service-item.service-featured {
    position: relative;
    overflow: visible !important; /* Permette al badge di uscire dai bordi */
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 157, 0.15);
}

/* Glow sottile sui bordi */
.service-item.service-featured::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 25px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(0, 255, 157, 0.3) 50%,
        transparent 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

/* Hover più evidente con effetto sul badge */
.service-item.service-featured:hover:not(.expanded) {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 255, 157, 0.3);
}

.service-item.service-featured:hover::after {
    transform: scale(1.05);
    box-shadow: 
        0 10px 35px rgba(102, 126, 234, 0.8),
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Badge Premium Tondeggiante - ULTRA FIGO */
.service-item.service-featured::after {
    content: '★ TOP SERVICE';
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 10px 24px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 50%,
        #f093fb 100%
    );
    border-radius: 50px;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
    animation: badgeEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-transform: uppercase;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    overflow: hidden;
}



@keyframes badgeEntrance {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.15) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}



/* Featured Espanso - Mantieni effetti */
.service-item.service-featured.expanded {
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(0, 255, 157, 0.3);
}

/* Responsive - badge sempre tondeggiante e figo */
@media (max-width: 768px) {
    .service-item.service-featured::after {
        font-size: 9px;
        padding: 8px 18px;
        letter-spacing: 1px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .service-item.service-featured::after {
        content: '★';
        font-size: 20px;
        padding: 10px;
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        top: 10px;
        right: 10px;
        letter-spacing: 0;
    }
}

