:root {
    --cct-primary-color: #00d2ff;
    --cct-secondary-color: #3a7bd5;
    --cct-bg-color: #0f172a;
    --cct-card-bg: #1e293b;
    --cct-text-color: #e2e8f0;
    --cct-text-muted: #94a3b8;
    --cct-line-width: 2px;
    --cct-line-active: #3a7bd5;
    --cct-line-inactive: #e2e8f0;
    --cct-marker-size: 40px;
    --cct-icon-size: 4rem;
    /* Hover Defaults: Inherit from normal state so they don't change unless overridden */
    --cct-marker-ring-size-hover: var(--cct-marker-ring-size);
    --cct-marker-ring-color-hover: var(--cct-marker-ring-color);
    --cct-marker-scale-hover: 1; /* Default é 1 (sem zoom) se não for ativado no widget */
}

/* Reset removed to avoid conflicts */
.timeline-container,
.timeline-container * {
    box-sizing: border-box;
}

.timeline-container {
    font-family: 'Inter', sans-serif;
    color: var(--cct-text-color);
    line-height: 1.6;
    position: relative;
    padding: 40px 0;
    min-height: 100px; /* Garante visibilidade mínima no editor */
}

/* Linha Central Container */
.timeline-container .timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: var(--cct-line-width);
    background-color: var(--cct-line-inactive);
    z-index: 0;
    overflow: hidden; /* Garante que a barra de progresso não vaze */
}

/* Barra de Progresso Dinâmica */
.timeline-container .timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%; /* Altura dinâmica controlada via JS */
    background-color: var(--cct-line-active);
    transition: height 0.1s linear; /* Suavidade no scroll */
}

/* Item Wrapper */
.timeline-container .timeline-item {
    display: flex;
    align-items: center; /* Centraliza verticalmente ícone, marker e texto */
    justify-content: center;
    position: relative;
    margin-bottom: 80px;
    width: 100%;
}

.timeline-container .timeline-item:last-child {
    margin-bottom: 0;
}

/* Áreas Flexíveis (50% cada) */
.timeline-container .timeline-visual,
.timeline-container .timeline-content {
    width: 50%;
    padding: 0 40px; /* Espaço entre o conteúdo e o centro */
    position: relative;
    z-index: 1;
}

/* Área Visual (Ícone Grande) */
.timeline-container .timeline-visual {
    display: flex;
    justify-content: flex-end; /* Alinha ícone perto do centro por padrão */
    align-items: center;
}

.timeline-container .visual-icon {
    font-size: var(--cct-icon-size); /* Ícone bem grande */
    color: var(--cct-primary-color);
    line-height: 1;
}
.timeline-container .visual-icon i, 
.timeline-container .visual-icon svg {
    display: block;
    width: 1em;
    height: 1em;
    font-size: inherit;
}

/* Animações */
.timeline-container .cct-animate-init {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline-container .cct-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Área de Conteúdo (Texto/Card) */
.timeline-container .timeline-content {
    text-align: left;
    background-color: var(--cct-card-bg);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-container .timeline-content:hover {
    transform: translateY(-5px);
}

/* Seta do Card (Triângulo) */
.timeline-container .timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    transform: translateY(-50%);
    z-index: 1;
}

/* Seta para itens Ímpares (Conteúdo na Direita -> Seta na Esquerda) */
/* Mas espere, no layout padrão (ímpar): Visual(Esq) - Marker - Content(Dir) */
/* Então a seta do content deve ficar na ESQUERDA do content */
.timeline-container .timeline-item:nth-child(odd) .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--cct-card-bg) transparent transparent;
}

/* Seta para itens Pares (Conteúdo na Esquerda -> Seta na Direita) */
/* Layout par: Content(Esq) - Marker - Visual(Dir) */
/* Seta na DIREITA do content */
.timeline-container .timeline-item:nth-child(even) .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--cct-card-bg);
}

.timeline-container .timeline-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--cct-text-color);
}

.timeline-container .timeline-content p {
    font-size: 0.95rem;
    color: var(--cct-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Marcador Central (Número) */
.timeline-container .timeline-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--cct-marker-size);
    height: var(--cct-marker-size);
    background-color: var(--cct-bg-color); /* Fundo do site para "cortar" a linha */
    border-radius: 12px; /* Redondo é mais moderno que quadrado arredondado */
    border: none; /* Garante que não haja borda nativa, apenas box-shadow se desejado */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    /* box-shadow removed to eliminate ring/halo effect globally */
    box-shadow: none; 
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.timeline-container .timeline-item:hover .timeline-marker {
    transform: translate(-50%, -50%) scale(1.1);
    /* box-shadow removed on hover as well */
    box-shadow: none;
}

.timeline-container .timeline-marker:focus,
.timeline-container .timeline-marker:focus-visible,
.timeline-container .timeline-marker:active,
.timeline-container .timeline-item:focus .timeline-marker,
.timeline-container .timeline-item:focus-visible .timeline-marker,
.timeline-container .timeline-item:active .timeline-marker,
.timeline-container .timeline-item.active .timeline-marker {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    /* Force transparent colors to be sure */
    --cct-marker-ring-color: transparent !important;
    --cct-marker-halo-color: transparent !important;
}

.timeline-container .step-number {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--cct-primary-color);
}

/* Lógica Zig-Zag */
/* Ímpar (Padrão): Visual (Esq) - Marker - Content (Dir) */
/* A ordem do HTML é Visual, Marker, Content. Flex padrão row já faz isso. */
/* Mas queremos alinhar Visual à direita (perto do centro) e Content à esquerda (perto do centro). Já setamos isso. */

/* Par (Invertido): Content (Esq) - Marker - Visual (Dir) */
.timeline-container .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-container .timeline-item:nth-child(even) .timeline-visual {
    justify-content: center;
}

.timeline-container .timeline-item:nth-child(odd) .timeline-visual {
    justify-content: center;
}

.timeline-container .timeline-item:nth-child(even) .timeline-content {
    text-align: right; /* Texto da esquerda alinhado à direita (perto do centro) */
}

/* Layout Invertido (Início pela Direita) */
.timeline-container.cct-layout-right .timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-container.cct-layout-right .timeline-item:nth-child(even) {
    flex-direction: row;
}

.timeline-container.cct-layout-right .timeline-item:nth-child(odd) .timeline-visual {
    /* Visual na Direita (row-reverse) -> Alinhar à Esquerda (perto do centro) */
    justify-content: flex-start;
    padding-left: 40px;
    padding-right: 0;
}

.timeline-container.cct-layout-right .timeline-item:nth-child(even) .timeline-visual {
    /* Visual na Esquerda (row) -> Alinhar à Direita (perto do centro) */
    justify-content: flex-end;
    padding-right: 40px;
    padding-left: 0;
}

.timeline-container.cct-layout-right .timeline-item:nth-child(odd) .timeline-content {
    /* Conteúdo na Esquerda -> Texto Alinhado à Direita */
    text-align: right;
    padding-right: 40px;
    padding-left: 0;
}

.timeline-container.cct-layout-right .timeline-item:nth-child(even) .timeline-content {
    /* Conteúdo na Direita -> Texto Alinhado à Esquerda */
    text-align: left;
    padding-left: 40px;
    padding-right: 0;
}

/* Setas para Layout Invertido */
/* Ímpar (Content na Esq, Seta na Dir) */
.timeline-container.cct-layout-right .timeline-item:nth-child(odd) .timeline-content::before {
    left: auto;
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--cct-card-bg);
}

/* Par (Content na Dir, Seta na Esq) */
.timeline-container.cct-layout-right .timeline-item:nth-child(even) .timeline-content::before {
    right: auto;
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--cct-card-bg) transparent transparent;
}

/* =========================================
   STYLES FOR MEDIA (IMAGES)
   ========================================= */
.timeline-container .visual-image {
    width: 100%;
    max-width: 300px; /* Limit image width */
    display: flex;
    justify-content: center;
}

.timeline-container .visual-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.timeline-container .timeline-item:hover .visual-image img {
    transform: translateY(-5px);
}

/* =========================================
   PRESET: MINIMAL
   ========================================= */
.timeline-container.cct-preset-minimal .timeline-content {
    background-color: transparent;
    box-shadow: none !important;
    border: none !important;
    padding-top: 0;
    padding-bottom: 0;
}

.timeline-container.cct-preset-minimal .timeline-content::before {
    display: none; /* Remove arrow */
}

.timeline-container.cct-preset-minimal .timeline-marker {
    width: 16px;
    height: 16px;
    box-shadow: none !important; /* Force remove shadow in minimal */
    /* Use global settings for colors/borders instead of hardcoding */
}

.timeline-container.cct-preset-minimal .step-number {
    display: none; /* Hide numbers for cleaner look */
}

.timeline-container.cct-preset-minimal .timeline-item:hover .timeline-marker {
    background-color: var(--cct-primary-color);
    transform: translate(-50%, -50%) scale(1.2);
}

/* =========================================
   PRESET: IMAGES (GALLERY)
   ========================================= */
.timeline-container.cct-preset-images .timeline-visual {
    padding: 0 20px; /* Reduce padding to give more space to image */
}

.timeline-container.cct-preset-images .visual-image img {
    border: 2px solid var(--cct-card-bg); /* Border matching card bg */
    aspect-ratio: 4/3; /* Consistent aspect ratio */
}

/* =========================================
   LAYOUT: LEFT ALIGNED (One Side - Desktop/All)
   ========================================= */
.timeline-container.cct-layout-left-aligned {
    padding-left: 0;
    padding-right: 0;
}

/* Grid Layout for Left Aligned */
.timeline-container.cct-layout-left-aligned .timeline-item,
.timeline-container.cct-layout-left-aligned .timeline-item:nth-child(even),
.timeline-container.cct-layout-left-aligned .timeline-item:nth-child(odd) {
    display: grid;
    grid-template-columns: 60px 1fr; /* Marker (60px) | Content */
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 8px;
    margin-bottom: 40px;
    flex-direction: unset !important; /* Override flex-direction from zig-zag */
    justify-content: unset;
}

/* Reset Widths */
.timeline-container.cct-layout-left-aligned .timeline-visual,
.timeline-container.cct-layout-left-aligned .timeline-content {
    width: auto;
    flex: unset;
    padding: 0;
    margin: 0;
}

/* Marker Placement */
.timeline-container.cct-layout-left-aligned .timeline-marker {
    position: static;
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    align-self: start;
    transform: none !important;
    margin-top: 4px;
}

/* Visual Placement (Icon/Image) */
.timeline-container.cct-layout-left-aligned .timeline-visual {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    text-align: left;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.timeline-container.cct-layout-left-aligned .visual-icon {
    font-size: 2.5rem; /* Slightly smaller than huge zig-zag icon */
    justify-content: flex-start;
}

/* Content Placement (Title/Desc) */
.timeline-container.cct-layout-left-aligned .timeline-content {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0 !important;
}

/* Remove Arrows */
.timeline-container.cct-layout-left-aligned .timeline-content::before {
    display: none !important;
}

/* Line Position */
.timeline-container.cct-layout-left-aligned .timeline-line {
    left: 30px; /* Center of 60px column */
    transform: translateX(-50%);
    width: 2px;
}

/* Responsividade Mobile */
@media (max-width: 1024px) {
    .timeline-container {
        padding-left: 0;
        padding-right: 0;
    }

    /* FORCE GRID LAYOUT (Left Aligned) for ALL items on Tablet/Mobile */
    .timeline-container .timeline-item, 
    .timeline-container .timeline-item:nth-child(even),
    .timeline-container .timeline-item:nth-child(odd),
    .timeline-container.cct-layout-left-aligned .timeline-item,
    .timeline-container.cct-layout-left-aligned .timeline-item:nth-child(even),
    .timeline-container.cct-layout-left-aligned .timeline-item:nth-child(odd) {
        display: grid;
        grid-template-columns: 60px 1fr; /* 60px Marker Column | Content */
        grid-template-rows: auto auto;
        column-gap: 16px;
        row-gap: 8px;
        margin-bottom: 32px;
        flex-direction: unset !important;
        justify-content: unset !important;
        align-items: start !important;
    }

    /* Reset Widths */
    .timeline-container .timeline-visual,
    .timeline-container .timeline-content {
        width: auto !important;
        flex: unset !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Marker Placement (Left Col, Row 1) */
    .timeline-container .timeline-marker {
        position: static !important;
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        align-self: start;
        transform: none !important;
        margin-top: 0; /* Align with top */
        
        /* Square Styling from Image */
        border-radius: 8px;
        width: 32px;
        height: 32px;
        background-color: var(--cct-bg-color, #ffffff);
        box-shadow: none;
        border: none;
        z-index: 2; /* Above line */
    }
    
    .timeline-container .timeline-marker .step-number {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--cct-primary-color);
    }

    /* Visual Placement (Right Col, Row 1 - Icon Above Text) */
    .timeline-container .timeline-visual {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-start !important;
        text-align: left !important;
        margin-bottom: 4px !important;
    }

    .timeline-container .visual-icon {
        font-size: 2rem;
        color: var(--cct-primary-color);
        line-height: 1;
        justify-content: flex-start !important;
    }
    
    .timeline-container .visual-image {
        max-width: 100%; 
        width: 48px;
        justify-content: flex-start !important;
    }

    /* Content Placement (Right Col, Row 2) */
    .timeline-container .timeline-content {
        grid-column: 2;
        grid-row: 2;
        text-align: left !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
    }
    
    /* Remove Arrow */
    .timeline-container .timeline-content::before,
    .timeline-container .timeline-item:nth-child(even) .timeline-content::before,
    .timeline-container .timeline-item:nth-child(odd) .timeline-content::before {
        display: none !important;
    }

    /* Line Position - Centered in 60px column */
    .timeline-container .timeline-line {
        left: 30px !important; /* Center of 60px */
        transform: translateX(-50%);
        width: 2px;
        background-color: var(--cct-primary-color, #e2e8f0); /* Ensure visibility */
        top: 0;
        bottom: 0;
    }
    
    /* Typography adjustments */
    .timeline-container .timeline-content h3 {
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
        line-height: 1.3;
        text-align: left;
    }
    
    .timeline-container .timeline-content p {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: left;
    }


    /* =========================================
       RESPONSIVE ALIGNMENT: RIGHT (Mobile/Tablet)
       ========================================= */
    .timeline-container.cct-responsive-right .timeline-item, 
    .timeline-container.cct-responsive-right .timeline-item:nth-child(even),
    .timeline-container.cct-responsive-right.cct-layout-right .timeline-item:nth-child(odd),
    .timeline-container.cct-responsive-right.cct-layout-right .timeline-item:nth-child(even) {
        grid-template-columns: 1fr 48px; /* Content Left | Marker Right */
    }

    /* Marker Placement (Right Col, Row 1) */
    .timeline-container.cct-responsive-right .timeline-marker {
        grid-column: 2;
        grid-row: 1;
    }

    /* Visual Placement (Left Col, Row 1) */
    .timeline-container.cct-responsive-right .timeline-visual {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-end; /* Align right (towards marker) */
        text-align: right;
    }

    .timeline-container.cct-responsive-right .visual-icon,
    .timeline-container.cct-responsive-right .visual-image {
        justify-content: flex-end;
    }

    /* Content Placement (Left Col, Row 2) */
    .timeline-container.cct-responsive-right .timeline-content {
        grid-column: 1;
        grid-row: 2;
        text-align: right;
        margin-right: 0;
    }

    /* Line Position (Right) */
    .timeline-container.cct-responsive-right .timeline-line {
        left: auto;
        right: 24px; /* Center of 48px column on right */
        transform: translateX(50%);
    }

    /* Adjust padding for minimal preset on right align */
    .timeline-container.cct-responsive-right.cct-preset-minimal .timeline-content {
        padding-right: 0;
        padding-left: 0;
    }
}
