:root {
  --bg-color: #1e1e1e;
  --header-bg: #2b2b2b;
  --text-color: #d1d4dc;
  --accent-color: #007bff;
  --border-color: #3e3e3e;
  --highlight-color: #4caf50;
  font-family: 'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
}

body,
html,
#root {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  /* Prevent scrolling */
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  height: 60px;
  background-color: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1.2rem;
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.status-badge.connected {
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.disconnected {
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
  animation: pulse 2s infinite;
}

.status-badge.error {
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.settings-panel {
  position: absolute;
  top: 50px;
  left: 20px;
  background: rgba(43, 43, 43, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.app-id-form {
  display: flex;
  gap: 8px;
}

.app-id-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 100px;
  outline: none;
}

.app-id-input:focus {
  border-color: var(--accent-color);
}

.save-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.save-btn:hover {
  opacity: 0.9;
}

.info-text {
  font-size: 0.7rem;
  color: #888;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

.logo-img {
  height: 32px;
  width: 32px;
  border-radius: 4px;
  object-fit: contain;
}

.highlight {
  color: var(--highlight-color);
}

.controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.selector-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deriv-select {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
}

.button-group {
  display: flex;
  background-color: #333;
  border-radius: 4px;
  overflow: hidden;
}

.tf-button {
  background: none;
  border: none;
  color: #aaa;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tf-button:hover {
  background-color: #444;
  color: #fff;
}

.tf-button.active {
  background-color: #555;
  color: #fff;
  font-weight: bold;
}

.divider {
  width: 1px;
  height: 24px;
  background-color: #555;
}

.zone-toggle-btn {
  background: none;
  border: 1px solid #555;
  color: #aaa;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.zone-toggle-btn:hover {
  background-color: #444;
  color: #fff;
  border-color: #666;
}

.zone-toggle-btn.active {
  background-color: #555;
  color: #fff;
  border-color: #2196f3;
}


.chart-wrapper {
  flex: 1;
  position: relative;
  background-color: #000;
  overflow: hidden;
  /* Ensure no leak */
}

/* Responsiveness */
@media (max-width: 600px) {
  .app-header {
    height: auto;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .controls {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .selector-container {
    width: 100%;
    justify-content: space-between;
  }

  .divider {
    display: none;
  }

  .app-container {
    height: 100dvh;
    /* Use dynamic viewport height */
  }
}

.logout-btn {
  background: none;
  border: 1px solid #555;
  color: #aaa;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: inherit;
}

.logout-btn:hover {
  background-color: rgba(239, 83, 80, 0.1);
  border-color: rgba(239, 83, 80, 0.5);
  color: #ef9a9a;
}/* ── Auth Backdrop ────────────────────────────────────────────── */
.auth-backdrop {
    position: fixed;
    inset: 0;
    background: #0d0d0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Subtle animated gradient background */
    background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(0, 123, 255, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 120%, rgba(76, 175, 80, 0.08) 0%, transparent 60%),
        #0d0d0f;
}

/* ── Card ─────────────────────────────────────────────────────── */
.auth-card {
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card.shake {
    animation: shake 0.55s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-10px);
    }

    30% {
        transform: translateX(8px);
    }

    45% {
        transform: translateX(-6px);
    }

    60% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }
}

/* ── Logo ─────────────────────────────────────────────────────── */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 28px;
}

.auth-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

/* ── Heading ──────────────────────────────────────────────────── */
.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.auth-heading p {
    font-size: 0.88rem;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* ── Form ─────────────────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #aaa;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    padding: 12px 42px 12px 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.auth-input-wrap input:focus {
    border-color: rgba(0, 123, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

.auth-input-wrap input::placeholder {
    color: #555;
}

/* ── Eye / show-hide btn ──────────────────────────────────────── */
.eye-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.eye-btn:hover {
    color: #aaa;
}

/* ── Password Strength ────────────────────────────────────────── */
.strength-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.strength-fill {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #333;
    position: relative;
    overflow: hidden;
}

.strength-fill::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-fill.s1::after {
    width: 33%;
    background: #ef5350;
}

.strength-fill.s2::after {
    width: 66%;
    background: #ff9800;
}

.strength-fill.s3::after {
    width: 100%;
    background: #4caf50;
}

.strength-label {
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 40px;
}

.strength-label.s1 {
    color: #ef5350;
}

.strength-label.s2 {
    color: #ff9800;
}

.strength-label.s3 {
    color: #4caf50;
}

/* ── Error ────────────────────────────────────────────────────── */
.auth-error {
    background: rgba(239, 83, 80, 0.12);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef9a9a;
    font-size: 0.83rem;
    padding: 10px 14px;
    border-radius: 8px;
    animation: fadeUp 0.2s ease;
}

/* ── Submit Button ────────────────────────────────────────────── */
.auth-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056cc 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 4px;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 123, 255, 0.4);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Spinner ──────────────────────────────────────────────────── */
.auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Footer note ──────────────────────────────────────────────── */
.auth-note {
    text-align: center;
    font-size: 0.73rem;
    color: #555;
    margin: 18px 0 0;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        margin: 16px;
        padding: 32px 24px;
    }
}/* Cleared to avoid layout conflicts with index.css */