/* Download Page Styles */
.download-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 50%, rgba(16, 185, 129, 0.05) 100%);
}

.download-card {
    max-width: 600px;
    width: 100%;
    background: var(--card);
    border: none;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.download-icon {
    font-size: 3.25rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.download-title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--vermelho) 0%, var(--verde) 50%, var(--azul) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.download-subtitle {
    font-size: 0.95rem;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.download-button {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.4), rgba(16, 185, 129, 0.4));
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: white;
    padding: 1.25rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px 0 rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.download-button:hover {
    transform: translateY(-4px);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.6), rgba(16, 185, 129, 0.6));
    box-shadow: 0 12px 40px 0 rgba(37, 99, 235, 0.5);
}

.download-button:active {
    transform: translateY(-2px);
}

.download-info {
    background: rgba(37, 99, 235, 0.1);
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    text-align: left;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--primary);
}

.info-value {
    color: var(--foreground);
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.back-link:hover {
    opacity: 0.8;
    gap: 0.75rem;
}

.features-list {
    text-align: left;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: none;
    border-radius: 12px;
}

.features-list h3 {
    color: #10b981;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.features-list ul {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.features-list li::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    font-size: 1rem;
}

/* Captcha Modal */
.captcha-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.captcha-overlay.active {
    display: flex;
}

.captcha-modal {
    position: relative;
    /* Para posicionar overlay global */
    background: var(--card);
    border: none;
    border-radius: 16px;
    padding: 1.75rem;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.captcha-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--foreground);
}

.captcha-question {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(37, 99, 235, 0.1);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: var(--azul);
}

.captcha-canvas-container {
    position: relative;
    /* Para posicionar o overlay */
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: var(--background);
    border: none;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    /* Transição suave para mudanças de cor de fundo */
    transition: background-color 0.8s ease-in-out;
}

.captcha-canvas {
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
    position: relative;
    z-index: 1;
    /* Transição suave para o canvas quando o fundo muda */
    transition: opacity 0.3s ease-in-out;
}

/* Overlay de bloqueio com blur */
.captcha-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: all;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: not-allowed;
}

.captcha-block-overlay.active {
    display: flex;
}

/* ⚛️ Contador Ternário (-1, 0, +1) - Passado, Presente, Futuro */
/* Representação: - (passado/bloqueio), 0 (presente/transição), + (futuro/livre) */
.binary-counter {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--vermelho) 0%, var(--verde) 50%, var(--azul) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    /* Remover shadow para degradê funcionar */
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5)) drop-shadow(0 0 20px rgba(5, 150, 105, 0.3)) drop-shadow(0 0 30px rgba(37, 99, 235, 0.2));
    letter-spacing: 0.5rem;
    animation: binaryPulse 0.5s ease-in-out infinite, gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.5)) drop-shadow(0 0 20px rgba(16, 185, 129, 0.3)) drop-shadow(0 0 30px rgba(16, 185, 129, 0.2));
    }

    33% {
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5)) drop-shadow(0 0 20px rgba(37, 99, 235, 0.3)) drop-shadow(0 0 30px rgba(16, 185, 129, 0.2));
    }

    66% {
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5)) drop-shadow(0 0 20px rgba(16, 185, 129, 0.3)) drop-shadow(0 0 30px rgba(37, 99, 235, 0.2));
    }
}

@keyframes binaryPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Animação de entrada do overlay */
.captcha-block-overlay.active {
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Overlay global para bloquear modal inteiro durante contagem */
.modal-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 200;
    display: none;
    pointer-events: all;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: not-allowed;
}

.modal-block-overlay.active {
    display: block;
}

.captcha-instruction {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.captcha-refresh {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.captcha-refresh-btn {
    background: var(--muted);
    color: var(--foreground);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.captcha-refresh-btn:hover {
    background: var(--border);
}

.captcha-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--background);
    color: var(--foreground);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    display: none;
}

.captcha-input:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.captcha-buttons {
    display: flex;
    gap: 1rem;
}

.captcha-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.captcha-btn-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.captcha-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.captcha-btn-cancel {
    background: var(--muted);
    color: var(--muted-foreground);
}

.captcha-btn-cancel:hover {
    background: var(--border);
}

.captcha-error {
    color: #ef4444;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 500;
    display: none;
}

.captcha-error.active {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* 🦀 GUAIAMUM: Controles de Perspectiva (Anatomia Funcional)
 * 
 * Baseado na anatomia do caranguejo Guaiamum:
 * - Patas Posteriores (↓): Longas, robustas → Locomoção rápida, escavação → Globe (+1.0)
 * - Patas Anteriores (↑): Curtas, equilíbrio → Assistência visual → Fisheye (-1.0)
 * - Garra Maior (←): Defesa, competição → Reflexão sobre passado → Rotação -45°
 * - Garra Menor (→): Manipulação, alimentação → Ação sobre futuro → Rotação +45°
 * - Centro (🦀): Sensores de vibração → Detecção de perigos → Plano (0.0)
 */
.guaiamum-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.guaiamum-btn {
    background: linear-gradient(135deg, var(--vermelho) 0%, var(--verde) 50%, var(--azul) 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.guaiamum-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.guaiamum-btn:active {
    transform: scale(0.95);
}

.guaiamum-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    animation: guaiamumPulse 1s ease-in-out infinite;
}

/* Botão centro maior e especial */
.guaiamum-center {
    width: 55px;
    height: 55px;
    font-size: 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.guaiamum-center:hover {
    transform: scale(1.15);
}

.guaiamum-center.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Animação de pulsação para botão ativo */
@keyframes guaiamumPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    }

    50% {
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.9);
    }
}

/* Tooltip para os botões */
.guaiamum-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.guaiamum-btn:hover::after {
    opacity: 1;
}

/* Responsividade dos botões do Guaiamum */
@media (max-width: 480px) {
    .guaiamum-controls {
        gap: 5px;
        padding: 8px;
    }

    .guaiamum-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .guaiamum-center {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .guaiamum-btn::after {
        font-size: 9px;
        padding: 3px 6px;
        bottom: -30px;
    }
}

/* Desktop - Telas extra grandes */
@media (min-width: 1440px) {
    .captcha-modal {
        max-width: 360px;
        padding: 1.5rem;
    }

    .captcha-title {
        font-size: 1.15rem;
    }
}

/* Desktop - Telas grandes */
@media (min-width: 1024px) {
    .captcha-modal {
        max-width: 380px;
        padding: 1.5rem;
    }

    .captcha-title {
        font-size: 1.2rem;
    }

    .captcha-canvas-container {
        padding: 0.75rem;
    }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .download-card {
        padding: 2rem 1.5rem;
    }

    .download-title {
        font-size: 1.375rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .captcha-modal {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .captcha-title {
        font-size: 1.125rem;
    }

    .captcha-canvas-container {
        padding: 0.5rem;
    }

    .captcha-instruction {
        font-size: 0.85rem;
    }
}