/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0A0A0B;
    --primary: #00D4FF;
    --secondary: #7B61FF;
    --success: #00FF88;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --border-tech: rgba(0, 212, 255, 0.3);
    --shadow-tech: rgba(0, 212, 255, 0.2);
    --modal-bg: rgba(10, 10, 11, 0.95);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
    width: 100vw;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Warning - Removido, agora funciona em mobile */

@media (max-width: 768px) {
    body {
        overflow: hidden;
    }

    .scene-container {
        position: relative;
        height: 100vh;
        width: 100vw;
        background: var(--bg-dark);
    }

    .frame-inicial {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        object-fit: contain;
        content: url('assets/agentes-vertical.png');
    }

    .agents-layer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 10;
    }

    .agent-hitbox {
        position: absolute;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        box-sizing: border-box;
    }

    /* METADE SUPERIOR (0-50vh) - 2 colunas */

    /* Sofia - topo esquerda (1º) */
    .agent-hitbox:nth-child(1) {
        top: 0;
        left: 0;
        width: 50vw;
        height: 50vh;
    }

    /* Lia - topo direita (2º) */
    .agent-hitbox:nth-child(2) {
        top: 0;
        left: 50vw;
        width: 50vw;
        height: 50vh;
    }

    /* METADE INFERIOR (50vh-100vh) - 3 colunas */

    /* Neo - esquerda (3º) */
    .agent-hitbox:nth-child(3) {
        top: 50vh;
        left: 0;
        width: 33.333vw;
        height: 50vh;
    }

    /* Carlão - centro (4º) */
    .agent-hitbox:nth-child(4) {
        top: 50vh;
        left: 33.333vw;
        width: 33.333vw;
        height: 50vh;
    }

    /* Alfred - direita (5º) */
    .agent-hitbox:nth-child(5) {
        top: 50vh;
        left: 66.666vw;
        width: 33.334vw;
        height: 50vh;
    }

    .balloon {
        position: fixed;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90%;
        width: 340px;
        z-index: 1000;
    }

    .modal-content {
        padding: 40px 24px 24px;
        width: 95%;
        max-width: 95%;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .modal-header p {
        font-size: 14px;
    }

    .form-field input {
        padding: 16px 14px;
        font-size: 15px;
    }

    .form-field label {
        font-size: 15px;
    }

    .submit-btn {
        padding: 16px 28px;
        font-size: 15px;
    }
}

/* App Container */
#app {
    width: 100%;
    height: 100%;
    position: relative;
}


/* Scene Container */
.scene-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.frame-inicial,
.agent-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-video {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.agent-video.active {
    opacity: 1;
    pointer-events: all;
}

/* Agents Layer */
.agents-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.agent-hitbox {
    position: absolute;
    cursor: pointer;
    width: 20%;
    height: 100%;
    top: 0;
    transition: filter 0.3s ease;
}

.agent-hitbox::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.agent-hitbox:hover::before {
    opacity: 0.3;
}

.agent-hitbox.glowing::before {
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Balloons */
.balloons-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.balloon {
    position: absolute;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-tech);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px var(--shadow-tech);
    pointer-events: all;
    opacity: 0;
    transform: translateY(10px);
    animation: balloonIn 0.2s ease forwards;
    min-width: 280px;
    max-width: 320px;
}

@keyframes balloonIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--border-tech);
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--modal-bg);
}

.balloon-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balloon-description {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.balloon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border: 1px solid var(--border-tech);
    border-radius: 6px;
    background: rgba(0, 212, 255, 0.05);
}

.balloon-link:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(2px);
    box-shadow: 0 0 20px var(--shadow-tech);
}

.balloon-link span {
    display: inline-block;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid var(--border-tech);
    border-radius: 20px;
    padding: 50px 40px 40px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.modal-close svg {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.modal-close:hover svg {
    color: var(--primary);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: 35px;
}

.modal-header h2 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 12px;
    line-height: 1.6;
    font-weight: 400;
}

/* Form */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-field {
    position: relative;
    margin-bottom: 4px;
}

.form-field input {
    width: 100%;
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
    outline: none;
    line-height: 1.5;
}

.form-field input:focus {
    border-color: var(--primary);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-field label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label {
    top: -10px;
    left: 12px;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0 6px;
    color: var(--primary);
}

.form-field input:placeholder-shown {
    background: transparent;
}

.field-error {
    position: absolute;
    bottom: -20px;
    left: 12px;
    font-size: 13px;
    color: #FF4444;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-field.error input {
    border-color: #FF4444;
}

.form-field.error .field-error {
    opacity: 1;
}

.submit-btn {
    margin-top: 12px;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn svg {
    transition: transform 0.3s ease;
}

.submit-btn:hover svg {
    transform: translateX(4px);
}

/* Agent Details Modal */
.modal-content.agent-details {
    max-width: 900px;
    padding: 50px 40px 40px;
}

.agent-details-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.agent-photo-section {
    flex: 0 0 250px;
    text-align: center;
}

.agent-photo {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.agent-name-title {
    margin-top: 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.agent-text-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.agent-detailed-description {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;
}

.agent-detailed-description p {
    margin-bottom: 15px;
}

.agent-detailed-description strong {
    color: var(--primary);
    font-weight: 600;
}

.test-agent-btn {
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.test-agent-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

/* Scrollbar customization for agent description */
.agent-detailed-description::-webkit-scrollbar {
    width: 6px;
}

.agent-detailed-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.agent-detailed-description::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .agent-details-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .agent-photo-section {
        flex: unset;
    }

    .agent-photo {
        width: 150px;
        height: 150px;
    }

    .agent-name-title {
        font-size: 20px;
        margin-top: 12px;
    }

    .agent-detailed-description {
        max-height: 300px;
        font-size: 14px;
        line-height: 1.7;
    }

    .modal-content.agent-details {
        max-width: 95%;
        padding: 40px 20px 24px;
    }

    .test-agent-btn {
        width: 100%;
        padding: 16px 28px;
        font-size: 15px;
    }
}

/* Thank You Modal */
.modal-content.thank-you {
    text-align: center;
    max-width: 400px;
}

.success-icon {
    margin-bottom: 20px;
    display: inline-block;
    animation: successScale 0.5s ease;
}

@keyframes successScale {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon svg {
    animation: drawCheck 0.5s ease 0.3s forwards;
}

@keyframes drawCheck {
    from {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    to {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.thank-you h2 {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--success);
}

.thank-you p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

.countdown-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.countdown-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    width: 100%;
    animation: countdown 5s linear forwards;
}

@keyframes countdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible {
    outline-offset: 4px;
}