/* Estilos Premium do Funil de Reboque - Estilo Chatbot */
#funnel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, sans-serif;
    color: white;
}

#funnel-container {
    width: 95%;
    max-width: 450px;
    height: 90vh; /* Aumentado para melhor visualização no mobile */
    max-height: 800px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    margin: 10px;
}

.funnel-header {
    padding: 20px;
    background: rgba(255, 215, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.attendant-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #ffb900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #000;
}

.attendant-status {
    flex: 1;
}

.attendant-name {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

.online-indicator {
    display: block;
    font-size: 0.75rem;
    color: #4CAF50;
}

.funnel-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
}

.funnel-chat-area::-webkit-scrollbar {
    display: none;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.chat-bubble.attendant {
    background: rgba(255, 255, 255, 0.08);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #eee;
}

.chat-bubble.user {
    background: #ffb900;
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.funnel-step {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.funnel-step.active {
    display: flex;
}

.funnel-input-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.funnel-input-group label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: -4px;
}

.funnel-input-group input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    padding: 8px 0;
    color: white;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.funnel-input-group input:focus {
    outline: none;
    border-color: #ffb900;
}

.funnel-btn {
    width: 100%;
    background: #ffb900;
    color: #000;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 185, 0, 0.2);
}

.funnel-btn:hover {
    transform: scale(0.98);
    background: #ffa000;
}

/* Typing Animation */
.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #ffb900;
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 1.5s infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Driver Card Chat */
.driver-card-chat {
    background: rgba(255, 185, 0, 0.1);
    border: 1px solid rgba(255, 185, 0, 0.2);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.driver-photo-small {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
}

/* PIX Screen */
.pix-screen {
    background: #fff;
    color: #000;
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.pix-qr {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 1/1;
    margin: 10px auto;
    display: block;
}

.close-funnel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    color: #fff;
    opacity: 0.4;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-funnel:hover { opacity: 1; }

.searching-animation {
    text-align: center;
    padding: 30px 0;
}

#pix-loading {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pix-content {
    animation: fadeIn 0.5s ease-out;
}

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

#pix-qr {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1/1;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    display: block;
    margin: 0 auto 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #ffb900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.copy-btn {
    background: #ffb900;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #ffa000;
}

/* == PROGRESS BAR == */
.funnel-progress {
    height: 3px;
    background: rgba(255,255,255,0.06);
    width: 100%;
    overflow: hidden;
}
.funnel-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffb900, #ff8c00);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* == DRIVER CARD PREMIUM == */
.driver-card-premium {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,185,0,0.07);
    border: 1px solid rgba(255,185,0,0.2);
    border-radius: 18px;
    padding: 14px;
    margin: 8px 0;
}
.driver-card-photo-wrap { position: relative; flex-shrink: 0; }
.driver-card-photo {
    width: 70px; height: 70px;
    border-radius: 16px; object-fit: cover;
    border: 2px solid rgba(255,185,0,0.4);
}
.driver-verified-badge {
    position: absolute; bottom: -4px; right: -4px;
    width: 20px; height: 20px;
    background: #4CAF50; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #1a1a1a;
}
.driver-card-info h4 { margin: 0 0 4px; font-size: 1rem; color: #ffb900; }
.driver-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.driver-rating .stars { color: #ffb900; font-size: 0.9rem; }
.driver-rating .rating-num { font-weight: 700; font-size: 0.9rem; }
.driver-rating .rating-count { color: #888; font-size: 0.78rem; }
.driver-specialty { font-size: 0.78rem; color: #888; margin: 2px 0 6px; }
.driver-eta { display: flex; align-items: center; gap: 5px; font-size: 0.82rem; color: #4CAF50; }

/* == PIX LOADING STEPS == */
.pix-loading-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pix-logo-anim { animation: pixSpin 1.5s linear infinite; filter: drop-shadow(0 0 8px rgba(0,180,216,0.4)); }
@keyframes pixSpin { to { transform: rotate(360deg); } }
.pix-loading-steps { display: flex; flex-direction: column; gap: 6px; }
.pix-step { font-size: 0.78rem; color: #bbb; padding: 4px 8px; border-radius: 6px; transition: all 0.3s; }
.pix-step.active { color: #333; background: rgba(0,180,216,0.1); font-weight: 600; }
.pix-step.done { color: #4CAF50; }

/* == TYPING ANIMATION == */
.typing-bubble {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 80px;
}
.typing-bubble .dot {
    width: 6px; height: 6px;
    background: #888; border-radius: 50%;
    animation: typingDot 1.2s infinite;
}
.typing-bubble .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%,60%,100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}
