/* =========================
   TELA PRINCIPAL WHATSAPP
========================= */
.wa-main-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px;
}

.wa-card {
    background: #181f2a;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    color: #e6eef6;
    border: 1px solid #2a3441;
    position: relative;
    overflow: hidden;
}

.wa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.wa-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #2a3441;
    padding-bottom: 20px;
}

.wa-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 15px 0;
    letter-spacing: 1px;
}

.wa-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #22c55e;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: #e6eef6;
}

.wa-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.wa-avatar-section {
    display: flex;
    justify-content: center;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.wa-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid #2a3441;
    background: #fff;
    transition: all 0.3s ease;
}

.avatar-overlay {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #181f2a;
    overflow: hidden;
}

.whatsapp-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wa-info-section {
    text-align: center;
}

/* Status duplicado removido - mantido apenas o badge no topo */

.instance-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.instance-label {
    font-size: 14px;
    color: #6366f1;
    font-weight: 600;
    margin-bottom: 10px;
}

.instance-number-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.instance-number {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}

.copy-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    min-width: 44px;
}

.copy-btn:hover {
    background: #5855eb;
    transform: scale(1.05);
}

.wa-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
}

.action-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.action-btn.danger:hover {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 18px;
}

.btn-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Estados do card conectado */
.wa-card.connected {
    border-color: #22c55e;
}

.wa-card.connected::before {
    background: linear-gradient(90deg, #22c55e, #16a34a, #15803d);
}

/* Responsivo */
@media (max-width: 768px) {
    .wa-card {
        margin: 10px;
        padding: 20px;
    }
    
    .wa-title {
        font-size: 20px;
    }
    
    .avatar-container {
        width: 100px;
        height: 100px;
    }
    
    .action-btn {
        min-width: 180px;
        padding: 12px 25px;
        font-size: 15px;
    }
}

/* =========================
   MODAL QR CODE
========================= */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.qr-modal-content {
    position: relative;
    background: #181f2a;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    color: #e6eef6;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a3441;
    padding-bottom: 15px;
}

.qr-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.qr-close-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qr-close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.qr-status-message {
    font-size: 16px;
    color: #3b82f6;
    margin-bottom: 20px;
    font-weight: 600;
    padding: 10px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.qr-status-message.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.qr-container {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    padding: 25px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.qr-placeholder {
    width: 340px;
    height: 340px;
    border-radius: 20px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.15);
    border: 4px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.qr-loader {
    text-align: center;
    color: #666;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-loader p {
    font-size: 14px;
    margin: 0;
}

.qr-instructions {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.1);
}

.qr-instructions p {
    margin: 8px 0;
    font-size: 15px;
    color: #059669;
    font-weight: 500;
}

.qr-instructions p:first-child {
    font-weight: 700;
    color: #047857;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.qr-instructions p:first-child::before {
    content: "📱";
    font-size: 20px;
}

/* QR Code Image - Qualidade máxima */
.qr-img {
    width: 95% !important;
    height: 95% !important;
    border-radius: 15px !important;
    object-fit: contain !important;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    image-rendering: pixelated !important;
    filter: contrast(1.1) brightness(1.05) !important;
    background: #ffffff !important;
    padding: 10px !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.qr-img:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Responsivo - Otimizado para leitura móvel */
@media (max-width: 768px) {
    .qr-modal-content {
        margin: 15px;
        padding: 25px;
        max-width: 95vw;
    }
    
    .qr-container {
        padding: 20px;
        margin: 20px 0;
    }
    
    .qr-placeholder {
        width: 300px;
        height: 300px;
        border-width: 3px;
    }
    
    .qr-img {
        width: 92% !important;
        height: 92% !important;
        padding: 12px !important;
    }
    
    .qr-header h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .qr-placeholder {
        width: 280px;
        height: 280px;
    }
    
    .qr-container {
        padding: 15px;
    }
}
