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

:root {
  --bg: #1a1a1a;
  --bg-img: url("../img/background/background-d.webp");
  --bg-card: #151515;
  --bg-card-mb: #1e1e1e;
  --bg-hover: #1e1e1e;
  --bg-nav: rgba(15, 15, 15, 0.85);
  --bg-la: #1e1e1e;
  --text: #f0f0f0;
  --text-muted: #888;
  --text-muted-sh: #666;
  --mba: #1e1e1e;
  --accent: #fff;
  --border: #222;
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  height: 100%;
}

body {
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

span,
label {
  transition: color var(--transition);
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  height: 4rem;
  -webkit-app-region: drag;
}

nav a,
nav button,
nav .nav-tabs {
  -webkit-app-region: no-drag;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 3px;
  gap: 4px;
}

.nav-tab {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  background: #1a1a1a;
  color: #f0f0f0;
}

.nav-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: var(--transition);
  text-decoration: none;
}

.nav-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Language Selector ── */
.language-selector-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-btn {
  width: 30px;
  height: 30px;
  border-radius: 50px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.language-btn:hover {
  background: var(--bg-hover);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-la);
  transition: var(--transition);
  font-size: 12px;
  white-space: nowrap;
}

.language-option:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.language-option.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.language-option-flag {
  font-size: 16px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.language-option-name {
  font-size: 11px;
  font-weight: 500;
}

/* ── Main Content ── */
main,
.controls-panel {
  transition: background-color 0.3s ease;
}

.section {
  padding: 32px 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}
