@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-color: #fdfaf6;
  --card-bg: #f9efe2;
  --text-primary: #212536;
  --text-secondary: #8e919d;
  --accent-orange: #eda97a;
  --accent-peach: #f9d8b8;
  --accent-navy: #2d3142;
  --white: #ffffff;
  --shadow-soft: 0 12px 32px rgba(45, 49, 66, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  user-select: none;
  margin: 0;
  padding: 0;
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

#layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: 100%;
  height: 100vh;
}

#app-container {
  width: 100%;
  max-width: 420px;
  background-color: var(--white);
  height: 100vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 480px) {
  #app-container {
    height: 90vh;
    border-radius: 40px;
    margin: 20px;
  }
}

.top-bar {
  display: flex;
  align-items: center;
  padding: 24px 24px 16px;
  gap: 16px;
}

.icon-btn {
  background: var(--accent-navy);
  color: var(--white);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-btn.back-btn {
  background: var(--accent-navy);
}

.icon-btn:hover {
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

.top-bar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  flex-grow: 1;
  text-align: center;
  color: var(--text-primary);
  margin-right: 36px;
}

.search-bar {
  margin: 0 24px 24px;
  background-color: var(--bg-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-orange);
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.search-bar input::placeholder {
  color: #c4c6cc;
}

.scanner-card {
  flex-grow: 1;
  margin: 0 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

#video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 28px;
  background-color: #e5e7eb;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

#video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: transparent;
}

#canva-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.overlay-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.action-btn {
  width: 32px;
  height: 32px;
}

.bg-white {
  background-color: var(--white);
  color: var(--text-primary);
}

.bg-navy {
  background-color: var(--accent-navy);
  color: var(--white);
}

#hud {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 20;
}

.hud-badge {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hud-badge.active {
  background-color: var(--accent-orange);
  color: var(--white);
}

.instruction-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 24px 0;
}

#settings-panel {
  padding: 0 24px;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-color);
  padding: 12px 16px;
  border-radius: 12px;
}

.setting-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

select, input[type="range"] {
  accent-color: var(--accent-orange);
  font-family: inherit;
  border: none;
  background: var(--white);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.bottom-nav {
  margin: 16px 24px 24px;
  background-color: var(--accent-peach);
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.nav-item {
  background: none;
  border: none;
  color: var(--accent-navy);
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.nav-item:hover, .nav-item.active {
  opacity: 1;
}

.nav-item.active-scan {
  opacity: 1;
  color: var(--accent-orange);
  transform: scale(1.1);
}

.nav-item:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Vocab Sidebar */

#vocab-panel {
  display: none;
}

@media (min-width: 900px) {
  #vocab-panel {
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: 28px;
    height: 90vh;
    max-height: 900px;
    width: 320px;
    box-shadow: var(--shadow-soft);
    padding: 24px;
    overflow: hidden;
  }
}

@media (max-width: 899px) {
  #vocab-panel.modal-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    padding: 24px;
  }
  
  .hidden-desktop {
    display: flex !important;
  }
}

.hidden-desktop {
  display: none;
}

#btn-vocab-mobile {
  display: none;
}
@media (max-width: 899px) {
  #btn-vocab-mobile {
    display: flex;
  }
  #layout-wrapper {
    align-items: flex-start;
  }
}

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

.vocab-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-primary);
}

#vocab-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#vocab-list li {
  padding: 12px 16px;
  background-color: var(--bg-color);
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

@media (min-width: 900px) {
  #vocab-list li {
    background-color: var(--card-bg);
  }
}

