/* ==========================================================================
   Dobra 4: Sequência de Pílulas (Vídeo Locking)
   ========================================================================== */

.pills-video-section {
    background-color: #000;
    position: relative;
    width: 100%;
    margin-bottom: 200px;
}

.pills-sticky-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pills-video, #pills-final-image {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#pills-final-image {
    display: none; /* Só aparece no fim do vídeo */
    width: 110% !important; /* Aumenta a largura para criar sobra de recorte */
    left: 0.3% !important;   /* Compensa a largura extra para manter centralizado */
    object-position: 46% center !important; /* Valores < 50% movem o conteúdo para a DIREITA */
    object-fit: cover;
}

/* Malha e Data Points */
.pills-mesh-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: none; /* Só aparece quando o vídeo termina */
    pointer-events: none; /* O click passa pros data points */
    animation: meshFadeIn 1.5s ease-out forwards;
}

@keyframes meshFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.pills-title-container {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    text-align: center;
    z-index: 10;
    width: auto;
    min-width: 60%;
    padding: 25px 45px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    opacity: 0;
    animation: titleExpand 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    transform-origin: center;
}

@keyframes titleExpand {
    0% {
        transform: translateX(-50%) scaleX(0);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 1;
    }
}

.pills-node-tag {
    color: #555;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 8px;
}

.pills-main-title {
    color: #fff;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 15px;
}

.pills-main-title .highlight {
    color: #ff503c;
}

.pills-subtitle {
    color: #888;
    font-size: 1rem;
    letter-spacing: 4px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.data-point {
    position: absolute;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: auto; /* Permite hover nos data points */
    cursor: pointer;
    opacity: 0;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.8s forwards;
}

@keyframes scaleIn {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.point-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: #ff503c;
    border-radius: 50%;
    z-index: 2;
    transition: transform 0.3s ease;
}

.data-point:hover .point-core {
    transform: translate(-50%, -50%) scale(1.5);
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 2px solid #ff503c;
    border-radius: 50%;
    z-index: 1;
    animation: pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.point-core.blue { background-color: #00e5ff; }
.pulse-ring.blue { border-color: #00e5ff; }

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.pills-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Deixa o scroll passar direto se necessário */
}

/* Conectores e Caixas */
.connection-lines {
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

.c-line {
    stroke-dasharray: 4 4;
    animation: dash-move 20s linear infinite;
}

@keyframes dash-move {
    to {
        stroke-dashoffset: -100;
    }
}

.pill-terminal {
    position: absolute;
    min-width: 250px;
    max-width: 320px;
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    transform: translate(-50%, -50%); 
    pointer-events: auto;
    opacity: 0;
    animation: boxFadeIn 0.8s ease-out 1s forwards;
    cursor: default;
    z-index: 20;
}

/* Header do Terminal (Estilo Mac) */
.pt-header {
    background-color: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #222;
}

.pt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pt-dot.close { background-color: #ff5f56; }
.pt-dot.min { background-color: #ffbd2e; }
.pt-dot.max { background-color: #27c93f; }

.pt-title {
    color: #555;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    margin-left: 10px;
}

.red-box .pt-title { color: #ff503c; opacity: 0.7; }
.blue-box .pt-title { color: #00e5ff; opacity: 0.7; }

/* Corpo do Terminal */
.pt-body {
    padding: 30px; /* Aumentado */
    font-family: 'JetBrains Mono', monospace;
    text-align: left;
}

.pt-body h3 {
    font-size: 1.6rem; /* Aumentado de 1.3rem */
    font-weight: 800;
    margin-bottom: 15px;
}

.red-text { color: #ff503c; }
.blue-text { color: #00e5ff; }

.pt-desc {
    color: #999;
    font-size: 14px; /* Aumentado de 12px */
    line-height: 1.6;
    margin-bottom: 20px;
}

.pt-separator {
    height: 1px;
    background-color: #222;
    margin-bottom: 20px;
}

.pill-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.pill-list li {
    font-size: 13px; /* Aumentado de 11px */
    color: #777;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.red-list li::before {
    content: "✓";
    color: #ff503c;
    font-weight: bold;
}

.blue-list li {
    color: #999;
}

.blue-list li::before {
    content: "✕";
    color: #555;
}

.pill-button {
    width: 100%;
    padding: 15px; /* Aumentado */
    background-color: transparent;
    border: 1px solid #fff;
    border-radius: 50px;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px; /* Aumentado de 12px */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pill-button:hover {
    background-color: #fff;
    color: #000;
}

/* Modificações de Neon */
.pill-terminal.red-box {
    animation: boxFadeIn 0.8s ease-out 1s forwards, neonPulseRed 2s infinite alternate 1.8s;
}

.pill-terminal.blue-box {
    animation: boxFadeIn 0.8s ease-out 1s forwards, neonPulseBlue 2s infinite alternate 1.8s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes boxFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); border-color: rgba(255, 255, 255, 0.2); }
}

/* Responsividade para Notebooks */
@media (max-width: 1440px) {
    .pills-title-container {
        padding: 15px 30px;
        min-width: 70%;
        top: 2%;
    }

    .pills-main-title {
        font-size: 2rem;
    }

    .pill-terminal {
        max-width: 280px;
        min-width: 230px;
    }

    .pt-header {
        padding: 8px 12px;
    }

    .pt-body {
        padding: 15px;
    }

    .pt-body h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .pt-desc {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .pt-separator {
        margin-bottom: 10px;
    }

    .pill-list li {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .pill-button {
        padding: 10px;
        font-size: 11px;
    }
}

@media (max-width: 1024px) {
    .pill-terminal {
        max-width: 250px;
        min-width: 200px;
    }
    
    .red-box { left: 25% !important; }
    .blue-box { left: 75% !important; }
}

/* Otimização Mobile (Phones) */
@media (max-width: 768px) {
    .pills-sticky-container {
        height: 140vh !important; /* Aumentado para dar mais folga vertical */
    }

    #pills-video, #pills-final-image {
        width: 100% !important;
        height: 140vh !important;
        left: 0 !important;
        object-position: center !important;
    }

    .pills-title-container {
        width: 95% !important;
        padding: 12px !important;
        top: 2% !important;
    }

    .pills-main-title {
        font-size: clamp(1.1rem, 5vw, 1.4rem) !important;
        margin-bottom: 5px !important;
    }

    .pills-subtitle {
        font-size: 0.8rem !important;
    }

    /* Terminais Dinâmicos para telas curtas */
    .pill-terminal {
        max-width: 90%;
        min-width: 280px;
        width: 320px;
        padding: 0;
    }

    .pt-body {
        padding: clamp(10px, 3vh, 20px) !important;
    }

    .pt-body h3 {
        font-size: clamp(1rem, 4vh, 1.2rem) !important;
        margin-bottom: clamp(4px, 1.5vh, 8px) !important;
    }

    .pt-desc {
        font-size: clamp(10px, 2.2vh, 12px) !important;
        margin-bottom: clamp(8px, 2vh, 12px) !important;
        line-height: 1.3;
    }

    .pill-list {
        margin-bottom: clamp(10px, 2.5vh, 20px) !important;
    }

    .pill-list li {
        font-size: clamp(9px, 2vh, 11px) !important;
        margin-bottom: clamp(2px, 1vh, 6px) !important;
    }

    .pill-button {
        padding: clamp(8px, 2.2vh, 12px) !important;
        font-size: clamp(10px, 2.2vh, 12px) !important;
    }

    .red-box { 
        left: 50% !important; 
        top: 35% !important; /* Puxado mais para cima */
    }

    .blue-box { 
        left: 50% !important; 
        top: 78% !important; /* Mantém o gap seguro */
    }

    /* Esconde elementos que poluem o mobile */
    .connection-lines, .data-point {
        display: none !important;
    }
}

@keyframes neonPulseRed {
    from { box-shadow: 0 0 5px rgba(255, 80, 60, 0.2), inset 0 0 5px rgba(255, 80, 60, 0.1); border-color: rgba(255, 80, 60, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 80, 60, 0.8), inset 0 0 10px rgba(255, 80, 60, 0.4); border-color: #ff503c; }
}

@keyframes neonPulseBlue {
    from { box-shadow: 0 0 5px rgba(0, 229, 255, 0.2), inset 0 0 5px rgba(0, 229, 255, 0.1); border-color: rgba(0, 229, 255, 0.5); }
    to { box-shadow: 0 0 20px rgba(0, 229, 255, 0.8), inset 0 0 10px rgba(0, 229, 255, 0.4); border-color: #00e5ff; }
}
