/* 1. ПІДКЛЮЧЕННЯ ЛОКАЛЬНИХ ШРИФТІВ */
/* Файли мають лежати в папці extension/fonts/ */
@font-face {
  font-family: 'Almarai';
  src: url('./fonts/Almarai-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Almarai';
  src: url('./fonts/Almarai-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

/* 2. ЗМІННІ (LIGHT MODE - DEFAULT) */
:root {
  --accent-purple: #6366F1;
  --bg-light: #F1F5F9;
  --bg-white: #FFFFFF;
  --text-main: #000000;
  --text-gray: #978787;
  --border-color: #E2E8F0;
  --dropdown-shadow: rgba(0, 0, 0, 0.1);
}

/* 3. ЗМІННІ (DARK MODE) */
body.dark-mode {
  --bg-white: #1a1b1e;   /* Згідно з макетом ExplaAI_dark.png */
  --bg-light: #25262b;
  --text-main: #ececec;
  --text-gray: #909296;
  --border-color: #373a40;
  --dropdown-shadow: rgba(0, 0, 0, 0.4);
}

/* 4. БАЗОВІ СТИЛІ */
body {
  margin: 0;
  font-family: 'Almarai', sans-serif;
  background-color: var(--bg-white);
  color: var(--text-main);
  /* Ширина автоматична для Side Panel, 350px для Popup */
  min-width: 300px;
  transition: background-color 0.3s, color 0.3s;
}

.expla-popup {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px;
  box-sizing: border-box;
}

/* 5. HEADER & LOGO */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.logo-icon {
  background: var(--accent-purple);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
}

/* 6. MENU & DROPDOWN */
.menu-container {
  position: relative;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}

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

.dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--dropdown-shadow);
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
}

.dropdown button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.dropdown button:hover {
  background-color: var(--bg-light);
}

.dropdown hr {
  margin: 0;
  border: none;
  border-top: 1px solid var(--border-color);
}

.hidden { display: none; }

/* 7. CONTENT AREA */
.content-area {
  flex-grow: 1;
}

.explanation-card {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 16px;
  min-height: 120px;
  transition: background-color 0.3s;
}

.explanation-card h3 {
  margin-top: 0;
  font-size: 15px;
  color: var(--text-main);
  opacity: 0.8;
}

.placeholder-text {
  color: var(--text-gray);
  font-size: 14px;
  line-height: 1.6;
}

/* 8. FOOTER & INPUT */
.footer {
  margin-top: 16px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.3s;
}

.input-wrapper:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.input-wrapper input {
  border: none;
  background: transparent;
  flex-grow: 1;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
}

.send-btn {
  background: none;
  border: none;
  color: var(--accent-purple);
  cursor: pointer;
  display: flex;
  padding: 0;
  transition: transform 0.2s;
}

.send-btn:hover {
  transform: scale(1.1);
}

/* Force white dropdown in dark mode */
body.dark-mode .dropdown {
  background: #FFFFFF;     /* біле тло меню */
  color: #000000;          /* чорний текст */
  border-color: #E2E8F0;   /* світла рамка */
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); /* м'яка тінь */
}

body.dark-mode .dropdown button {
  color: #000000;          /* чорний текст в кнопках меню */
}

body.dark-mode .dropdown button:hover {
  background-color: #F1F5F9;  /* світлий hover */
}
