/* Conteúdo de style.css */
/* ===== RESET E CONFIGURAÇÕES GLOBAIS ===== */
* { box-sizing: border-box; }

/* ===== BODY E LAYOUT PRINCIPAL ===== */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(to right top, #0f2027, #203a43, #2c5364);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
  background: rgba(30,30,47,0.95);
  backdrop-filter: blur(10px);
  padding: 30px 20px 20px 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* ===== LOGO E TÍTULOS ===== */
.logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 0 5px rgba(0,198,255,0.4));
}

h1 { text-align: center; font-size: 24px; margin-bottom: 5px; }
h2 { text-align: center; font-size: 14px; color: #bbb; margin: 0 0 20px; }

/* ===== SISTEMA DE ABAS ===== */
.tabs { 
  display: flex; 
  gap: 10px;
  margin-bottom: 20px; 
}
.tab-btn {
  flex: 1; padding: 10px; border: none; border-radius: 8px;
  background-color: #2a2a40; color: #ccc;
  font-weight: bold; cursor: pointer; transition: 0.3s;
}
.tab-btn.active { background: linear-gradient(to right,#00c6ff,#0072ff); color: #fff; }

/* ===== CAMPOS DE ENTRADA ===== */
input, select, textarea {
  width: 100%; padding: 12px; margin: 8px 0;
  border: none; border-radius: 8px; background: #2e2e40;
  color: #fff; font-size: 14px;
}
select { cursor: pointer; }
select option { background: #2e2e40; color: #fff; }
textarea { resize: vertical; min-height: 60px; }

/* ===== BOTÕES E AÇÕES ===== */
.actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
}
.actions button {
  flex: 1 1 48%; padding: 12px; font-size: 14px;
  background: linear-gradient(to right,#00c6ff,#0072ff);
  border: none; border-radius: 8px; color: white;
  cursor: pointer; transition: background 0.3s;
}
.actions button:hover {
  background: linear-gradient(to right,#0072ff,#00c6ff);
}
.actions button:disabled {
  background: #444; cursor: not-allowed; opacity: 0.6;
}

/* ===== MENSAGENS DE STATUS ===== */
.result { margin: 15px 0 0; text-align: center; font-weight: bold; }
.status-connected { color: #00ff99; }
.status-disconnected { color: #ff5555; }
.status-pending { color: #ffcc00; }
.status-unknown { color: #ccc; }
.status-error { color: #ff4444; }

/* ===== QR CODE ===== */
#qrArea img.qrcode {
  margin-top: 15px; max-width: 100%;
  border: 2px solid #00c6ff; border-radius: 8px;
  display: block; margin-left: auto; margin-right: auto;
}

/* ===== ANIMAÇÃO DE LOADING ===== */
.loading {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #00c6ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== CAIXAS INFORMATIVAS ===== */
.info-box {
  background: rgba(0,198,255,0.1);
  border: 1px solid rgba(0,198,255,0.3);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
  font-size: 12px;
  color: #bbb;
}

.warning-box {
  background: rgba(255,193,7,0.1);
  border: 1px solid rgba(255,193,7,0.3);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  font-size: 13px;
  color: #ffc107;
  text-align: center;
}
.warning-box strong {
  color: #fff;
  display: block;
  margin-bottom: 8px;
}

.success-box {
  background: rgba(40,167,69,0.1);
  border: 1px solid rgba(40,167,69,0.3);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}
.success-box .title {
  color: #28a745;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
}

/* ===== SISTEMA DE CREDENCIAIS ===== */
.credential-item {
  background: rgba(0,0,0,0.3);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}
.credential-item:hover {
  background: rgba(0,198,255,0.1);
  border-color: #00c6ff;
}
.credential-label {
  font-weight: bold;
  color: #ccc;
  font-size: 12px;
  margin-bottom: 2px;
}
.credential-value {
  font-family: 'Courier New', monospace;
  color: #fff;
  font-size: 14px;
  word-break: break-all;
}
.copy-icon {
  color: #00c6ff;
  font-size: 18px;
  margin-left: 10px;
}
.copied {
  animation: pulse 0.6s;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ===== OPÇÕES AVANÇADAS ===== */
.advanced-options {
  margin-top: 15px;
  padding: 15px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid #333;
}
.advanced-toggle {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 10px;
}
.advanced-toggle:hover { border-color: #00c6ff; }
.full-width { flex: 1 1 100%; }

/* ===== SISTEMA DE MODAIS ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
}
.modal-content {
  background: rgba(30,30,47,0.98);
  margin: 3% auto;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}
.modal-title {
  font-size: 20px;
  font-weight: bold;
  color: #00c6ff;
}
.close {
  background: none;
  border: none;
  color: #ccc;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close:hover { color: #ff5555; }

/* ===== CONFIGURAÇÕES COM TOGGLE ===== */
.setting-item {
  display: flex;
  flex-direction: column;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid #333;
}
.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.setting-label {
  font-weight: bold;
  color: #fff;
  font-size: 14px;
}
.setting-description {
  font-size: 12px;
  color: #bbb;
  margin-bottom: 10px;
}

/* ===== SWITCH TOGGLE ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  border-radius: 24px;
  transition: 0.3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider {
  background-color: #00c6ff;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* ===== ELEMENTOS AUXILIARES ===== */
.setting-textarea {
  margin-top: 10px;
  display: none;
}
.setting-textarea.show {
  display: block;
}
.setting-input {
  margin-top: 10px;
}

/* ===== SEÇÕES DO CHATWOOT ===== */
.chatwoot-section {
  border-bottom: 1px solid #444;
  padding-bottom: 15px;
  margin-bottom: 15px;
}
.chatwoot-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.section-title {
  color: #00c6ff;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== CREDENCIAIS DO PROXY ===== */
.proxy-credentials {
  display: none;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #444;
}
.proxy-credentials.show {
  display: block;
}
.dual-input {
  display: flex;
  gap: 10px;
}
.dual-input input {
  flex: 1;
}

/* ===== RODAPÉ DENTRO DO CONTAINER ===== */
.footer {
  margin-top: 25px;
  padding-top: 20px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer p {
  margin: 0;
  font-size: 12px;
  color: #bbb;
}
.footer a {
  color: #00c6ff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}
.footer a:hover {
  color: #0072ff;
  text-decoration: underline;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 500px) {
  .actions button { flex: 1 1 100%; }
  .modal-content {
    margin: 2% auto;
    width: 95%;
    max-height: 95vh;
  }
  .dual-input {
    flex-direction: column;
    gap: 0;
  }
  .tabs {
    gap: 8px;
  }
}