/* CSS Variables & Global Reset */
:root {
  --bg-dark: #0f172a;
  --header-bg: rgba(15, 23, 42, 0.85);
  --card-bg: rgba(30, 41, 59, 0.7);
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --success-color: #10b981;
  --header-height: 60px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-family);
  color: var(--text-main);
}

body {
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.app-header {
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header.collapsed {
  margin-top: calc(-1 * var(--header-height));
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.badge {
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.live-badge {
  color: #64748b;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Header Center - URL Display */
.header-center {
  display: flex;
  align-items: center;
}

.url-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.url-display i {
  color: var(--success-color);
  font-size: 0.75rem;
}

.url-text {
  font-family: monospace;
  color: #cbd5e1;
}

.url-tag {
  background: var(--accent-light);
  color: #818cf8;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Header Right - Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.5);
  color: var(--text-main);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-google {
  background: #ea4335;
  border-color: #ea4335;
  color: #ffffff;
}

.btn-google:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(234, 67, 53, 0.35);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

/* Restore Header Button */
.btn-restore-header {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 101;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-restore-header:hover {
  transform: scale(1.1);
  background: var(--accent-hover);
}

.btn-restore-header.hidden {
  display: none;
}

/* Workspace & Iframe */
.workspace {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background-color: #090d16;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--accent-light);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Left Overlay Banner (Covering RevidAPI Sidebar) */
.left-banner {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background-color: #0f172a;
  border-right: 1px solid var(--border-color);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.banner-content {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  overflow-y: auto;
}

/* Banner Scrollbar */
.banner-content::-webkit-scrollbar {
  width: 4px;
}
.banner-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Banner Header */
.banner-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
}

.banner-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1, #10b981);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.6rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.banner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.banner-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Hotline Card */
.hotline-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 1rem 0.85rem;
  text-align: center;
}

.hotline-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hotline-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.03em;
  margin: 4px 0;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
}

.hotline-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.hotline-actions {
  display: flex;
  gap: 6px;
}

.btn-hotline, .btn-zalo {
  flex: 1;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-hotline {
  background: #10b981;
  color: #ffffff;
}

.btn-hotline:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-zalo {
  background: #0068ff;
  color: #ffffff;
}

.btn-zalo:hover {
  background: #0052cc;
  transform: translateY(-1px);
}

/* Features List */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.feature-item i {
  color: var(--success-color);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* Promo Box */
.promo-box {
  margin-top: auto;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.promo-icon {
  color: #f59e0b;
  font-size: 1.1rem;
  margin-top: 2px;
}

.promo-text strong {
  display: block;
  font-size: 0.78rem;
  color: #fbbf24;
  margin-bottom: 2px;
}

.promo-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Bottom Overlay Banner (Covering RevidAPI Footer) */
.bottom-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: #0f172a;
  border-top: 1px solid var(--border-color);
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-banner-left span {
  color: #94a3b8;
  font-size: 0.75rem;
}

.bottom-banner-center {
  display: flex;
  align-items: center;
}

.bottom-hotline-pill {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 5px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.bottom-hotline-pill strong {
  color: #6ee7b7;
  letter-spacing: 0.02em;
}

.bottom-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}

.bottom-link:hover {
  color: var(--accent-color);
}

.divider {
  color: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-center {
    display: none;
  }
  .btn span {
    display: none;
  }
  .btn {
    padding: 7px 10px;
  }
  .left-banner {
    width: 220px;
  }
  .bottom-banner-left, .bottom-banner-right {
    display: none;
  }
  .bottom-banner {
    justify-content: center;
    padding: 0 0.5rem;
  }
}

/* Login Page Styling */
.login-body {
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}

.login-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-color), #10b981);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #ffffff;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.login-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Alert Styling */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Demo Credentials Hint */
.demo-credentials {
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-color);
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.demo-credentials strong {
  color: #34d399;
}

.demo-credentials .divider {
  color: rgba(255, 255, 255, 0.2);
}

/* Login Footer */
.login-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-footer strong {
  color: #34d399;
}



