:root {
  --bg-color: #090c15; 
  /* Trong suốt hơn để làm hiệu ứng kính */
  --card-bg: rgba(30, 41, 59, 0.4); 
  --border-color: rgba(148, 163, 184, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --accent: #8b5cf6;
  --glow: rgba(99, 102, 241, 0.3); /* Thêm màu phát sáng */
  /* Colors for XML Highlighting */
  --xml-tag: #818cf8;
  --xml-key: #f472b6;
  --xml-string: #34d399;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 50% -20%, #1e1b4b 0%, var(--bg-color) 70%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 600px; margin: 0 auto; padding: 40px 20px; }

.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.header h1 { 
  font-size: 26px; 
  background: linear-gradient(to right, #818cf8, #c084fc); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  filter: drop-shadow(0 0 15px rgba(129, 140, 248, 0.3));
}
.header p { color: var(--text-muted); font-size: 13px; text-align: left; letter-spacing: 0.5px; }


.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #e2e8f0; }


.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.2);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}
.drop-zone-content svg { color: var(--text-muted); margin-bottom: 10px; transition: 0.3s; }
.drop-zone:hover .drop-zone-content svg { color: var(--primary); transform: scale(1.1); }
.drop-zone-content p { font-size: 13px; color: var(--text-muted); }
.drop-zone-content span { color: var(--primary); font-weight: 600; }

.input-group { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }

input[type="text"], input[type="password"] {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.5); color: var(--text-main); font-family: inherit; outline: none;
  transition: 0.3s;
}
input[type="text"]:focus, input[type="password"]:focus { 
  border-color: var(--primary); 
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); 
}

button { cursor: pointer; border: none; transition: 0.3s; font-family: inherit; }
.btn-primary {
  width: 100%; padding: 14px; border-radius: 10px; 
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 15px var(--glow); /* Nút phát sáng */
}
.btn-primary:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); 
}

.btn-secondary {
  flex: 1; padding: 12px; border-radius: 8px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color); color: var(--text-main); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--text-muted); }
.action-group { display: flex; gap: 12px; margin-top: 16px; }

.btn-icon { background: none; color: var(--text-muted); padding: 5px; border-radius: 5px; }
.btn-icon:hover { color: var(--text-main); background: rgba(255,255,255,0.1); transform: rotate(90deg); }
.btn-text { background: none; color: var(--primary); font-size: 12px; font-weight: 600; }
.btn-text:hover { filter: brightness(1.2); text-decoration: underline; }

.preview {
  width: 100%; height: 200px; padding: 16px; border-radius: 10px; background: #050810;
  border: 1px solid var(--border-color); overflow: auto; font-size: 12px; white-space: pre;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.xml-tag { color: var(--xml-tag); }
.xml-key { color: var(--xml-key); }
.xml-string { color: var(--xml-string); }

#qrcode { margin-top: 20px; justify-content: center; display: none; }
#qrcode canvas { background: white; padding: 8px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.qr-error { width: 100%; padding: 12px; background: rgba(239,68,68,0.1); color: #f87171; font-size: 12px; border-radius: 8px; text-align: center; }

.history-item { padding: 12px; background: rgba(15,23,42,0.3); border: 1px solid var(--border-color); border-radius: 8px; margin-top: 8px; cursor: pointer; font-size: 13px; transition: 0.2s; }
.history-item:hover { border-color: var(--primary); transform: translateX(5px); background: rgba(15,23,42,0.6); }

.toast {
  position: fixed; 
  bottom: 40px; 
  left: 50%; 

  transform: translateX(-50%) translateY(40px) scale(0.85);
  
  background: rgba(15, 23, 42, 0.85); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  color: #f8fafc; 
  padding: 14px 28px; 
  border-radius: 50px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  
  font-size: 13px; 
  font-weight: 600;
  letter-spacing: 0.3px;
  
  opacity: 0; 
  visibility: hidden; 
  z-index: 9999;

  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

.toast.show { 
  opacity: 1; 
  visibility: visible; 

  transform: translateX(-50%) translateY(0) scale(1); 
}

.tabs {
  display: flex; gap: 10px; margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.4); padding: 6px; border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow-x: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto; white-space: nowrap; 
  background: transparent; color: var(--text-muted);
  padding: 12px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tab-btn:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }
.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.tab-content { display: none; animation: slideIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.tab-content.active { display: block; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; transform: translateX(0); }
}

.custom-input {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.5); color: var(--text-main); font-family: inherit; outline: none; text-align: center; transition: 0.3s;
}
.custom-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.mini-drop { padding: 10px; margin-bottom: 0; display: flex; align-items: center; justify-content: center; height: 100%;}
.mini-drop span { font-size: 12px; color: var(--primary); font-weight: 600; word-break: break-all;}

.verified-badge {
  display: inline-flex; align-items: center; background: rgba(16, 185, 129, 0.15); 
  color: #10b981; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.signer-result-box {
  margin-top: 20px; display: none; padding: 16px; background: rgba(16, 185, 129, 0.1); 
  border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 10px; word-break: break-all; font-size: 13px; line-height: 1.5;
}
.signer-result-box strong { color: #10b981; }
.signer-result-box a { color: var(--text-main); text-decoration: none; display: block; margin-top: 5px; opacity: 0.9;}

.btn-success {
  width: 100%; padding: 14px; border-radius: 10px; background: linear-gradient(135deg, #10b981, #059669); color: white; font-weight: 700; 
  display: none; align-items: center; justify-content: center; gap: 8px; 
  margin-top: 15px; border: none; cursor: pointer; transition: 0.3s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); filter: brightness(1.1); }

.loading { animation: pulse 1.5s infinite ease-in-out; pointer-events: none; opacity: 0.8;}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-box {
  background: rgba(15, 23, 42, 0.4); border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary); padding: 16px 12px; border-radius: 8px; text-align: left;
  transition: 0.3s;
}
.stat-box:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.2); border-top-color: var(--accent); }
.stat-box h4 { color: var(--text-muted); font-size: 11px; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; }
.stat-box p { font-size: 22px; color: var(--text-main); font-weight: 700; margin: 0; font-family: inherit; }

.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: rgba(99, 102, 241, 0.1);
  border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 15px; box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.social-grid { display: flex; flex-direction: column; gap: 12px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; background: rgba(15, 23, 42, 0.4); border: 1px solid var(--border-color);
  border-radius: 12px; color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: all 0.3s ease; cursor: pointer; font-family: inherit;
}
.social-btn:hover {
  background: rgba(99, 102, 241, 0.15); border-color: var(--primary);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.repo-file-list {
  display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; background: rgba(15, 23, 42, 0.2);
}

.repo-file-item {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02); border-radius: 6px; border: 1px solid transparent; transition: 0.2s;
}
.repo-file-item:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(99, 102, 241, 0.5); }
.repo-file-name { font-size: 13px; color: var(--text-main); word-break: break-all; flex: 1; margin-right: 10px; }

.repo-actions { display: flex; gap: 6px; }
.btn-action { background: none; border: none; padding: 6px; border-radius: 4px; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.btn-action.edit:hover { color: var(--primary); background: rgba(99, 102, 241, 0.15); }
.btn-action.del:hover { color: #ef4444; background: rgba(239, 68, 68, 0.15); }

.custom-textarea {
  width: 100%; height: 250px; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: #050810; color: #a5b4fc; font-family: inherit; font-size: 12px; outline: none; resize: vertical; transition: 0.3s;
}
.custom-textarea:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
