/* ===========================================
   KURSLINE — Основной стиль сайта
   =========================================== */

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #222;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

/* ---------- HEADER ---------- */
header {
  background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  padding: 15px 20px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

header h1 img {
  height: 32px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  margin-right: 8px;
  display: inline-block;
}

.header-subtitle {
  font-size: 15px;
  line-height: 1.6;
  margin-top: 14px;
  color: #444;
  border-left: 3px solid #007bff;
  padding-left: 10px;
  font-style: italic;
  opacity: 0.9;
}

/* ---------- ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ---------- */
#themeToggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #444;
  transition: transform 0.2s, color 0.2s;
}

#themeToggle:hover {
  color: #007bff;
  transform: scale(1.15);
}

/* ---------- ГОРОДА ---------- */
#city-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 90px;
  overflow-y: auto;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  #city-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  #city-bar::-webkit-scrollbar {
    height: 5px;
  }
  #city-bar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
  }
}

#city-bar button {
  background: #eee;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

#city-bar button:hover {
  background: #e2e6ea;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#city-bar button.active {
  background: #007bff;
  color: white;
}

/* ---------- MAIN + TABLE ---------- */
main {
  max-width: 1200px;
  margin: 20px auto;
  background: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
}

tbody tr:nth-child(odd) {
  background: #fafafa;
}

tbody tr:hover {
  background: #eef4ff;
}

th {
  background: #f2f2f2;
  user-select: none;
}

th select {
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  color: #888;
}

.sort-btn.active {
  color: #007bff;
  font-weight: bold;
}

.best-buy { color: green; font-weight: bold; }
.best-sell { color: red; font-weight: bold; }

.exchange-name { font-weight: 600; }
.exchange-address { color: #555; font-size: 13px; }
.exchange-comment { font-size: 12px; color: #777; font-style: italic; }

#notice {
  background: #fff3cd;
  color: #856404;
  padding: 10px 15px;
  margin-top: 10px;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  display: none;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- ПОДСКАЗКА ---------- */
.hint-bar {
  background: #e8f4ff;
  color: #004a99;
  border: 1px solid #bcdfff;
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#showAllBtn {
  background: none;
  border: none;
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
}

/* ---------- ГРАФИК РАБОТЫ (popover) ---------- */
.schedule-popover {
  position: absolute;
  background: #fff;
  color: #222;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  padding: 8px 10px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  width: 120px;
  max-width: 90vw;
}

.schedule-popover.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.schedule-popover .arrow {
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
  filter: drop-shadow(0 -1px 1px rgba(0,0,0,0.12));
}

.schedule-popover .content {
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.schedule-popover .sched-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.schedule-popover .sched-row .left { color: #222; }
.schedule-popover .sched-row .right { color: #555; }

/* ---------- КАЛЬКУЛЯТОР ---------- */
.calc-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.calc-content {
background: #fff; 
	color: #111; 
	padding: 22px 25px; 
	border-radius: 12px; 
	box-shadow: 0 5px 20px rgba(0,0,0,0.3); 
	min-width: 280px; 
	max-width: 340px; 
	text-align: center; 
	position: relative; 
	animation: fadeIn .25s ease; 
	box-sizing: border-box;
}

.close-btn {
  position: absolute;
  top: 8px; right: 12px;
  cursor: pointer;
  font-size: 20px;
  color: #777;
  transition: color .2s;
}
.close-btn:hover { color: #000; }

.calc-content h3 { margin: 0 0 4px; font-weight: 600; }
.calc-type { font-size: 15px; color: #555; margin: 2px 0; }
.calc-rate { font-size: 14px; color: #007bff; margin-bottom: 10px; font-weight: 500; }

.calc-direction { margin-bottom: 10px; text-align: left; }
.calc-direction label { display: block; font-size: 14px; color: #333; margin-bottom: 3px; }
.calc-direction select {
  width: 100%; 
	padding: 7px 10px; 
	font-size: 15px;
  border: 1px solid #ccc; 
	border-radius: 6px; 
	background: #fafafa;
	box-sizing: border-box;
}

#calc-amount {
  width: 100%; 
	padding: 10px; 
	font-size: 16px;
  border: 1px solid #ccc; 
	border-radius: 6px;
  text-align: right; 
	margin-bottom: 12px;
	box-sizing: border-box;
}

.calc-result { font-size: 17px; font-weight: 600; color: #007bff; word-wrap: break-word;}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- ВАЖНАЯ ИНФОРМАЦИЯ ---------- */
.exchange-info {
  width: 90%;
  max-width: 1400px;
  margin: 60px auto 20px auto; /* ⬇ нижний отступ уменьшен с 60 до 40 */
  padding: 0 20px;
}

.exchange-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d3b66;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 18px;
  border-bottom: 2px solid #0d3b66;
  display: inline-block;
  padding-bottom: 4px;
}

.exchange-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 8px 0 30px 0;
  color: #1a1a1a;
  text-align: center;
}

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.exchange-card {
  background: #f8f9fa;
  border: 1px solid #e3e6eb;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;

}
.exchange-card p {
  font-size: 0.93rem;     /* немного меньше стандартного */
  line-height: 1.55;      /* читаемость сохраняется */
  color: #333;
  margin-bottom: 8px;
}

.exchange-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exchange-card .icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

/* ---------- ДИСКЛЕЙМЕР ---------- */
.disclaimer {
  background: #f1f3f6;
  border-left: 4px solid #0d3b66;
  border-radius: 10px;
  padding: 10px 25px 18px 25px; /* ⬆️ уменьшили верхний padding с 18 до 10 */
  margin: 20px auto 50px auto;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  width: 90%;
  max-width: 1400px;
}

.disclaimer h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #0d3b66;
  text-align: left;
  margin-top: 0;        /* ⬆️ убрали возможный внешний отступ сверху */
  margin-bottom: 10px;
}

.disclaimer p {
  color: #333;
  line-height: 1.1;
  margin-bottom: 8px;
  font-size: 0.9rem;
}


/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  font-size: 8px;
  color: #777;
  margin-top: 25px;
  padding: 15px;
}

/* ---------- ТЁМНАЯ ТЕМА ---------- */
body.dark-mode {
  background: #1e1e1e;
  color: #ddd;
}

body.dark-mode header { background: #2b2b2b; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
body.dark-mode h1 { color: #fff; }
body.dark-mode #city-bar button { background: #3a3a3a; color: #ccc; }
body.dark-mode #city-bar button.active { background: #007bff; color: #fff; }
body.dark-mode main { background: #2a2a2a; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
body.dark-mode th { background: #333; color: #ccc; }
body.dark-mode td { border-color: #444; }
body.dark-mode tbody tr:nth-child(odd) { background: #2d2d2d; }
body.dark-mode tbody tr:hover { background: #3a3a3a; }
body.dark-mode .exchange-address,
body.dark-mode .exchange-comment { color: #aaa; }
body.dark-mode #notice { background: #3d3419; border-color: #5a4d24; color: #f1d87a; }
body.dark-mode footer { color: #aaa; }
body.dark-mode footer a { color: #66aaff; }
body.dark-mode .hint-bar { background: #2b3a4a; color: #cce6ff; border-color: #3f556d; }

body.dark-mode .schedule-popover {
  background: #2b2b2b;
  color: #ddd;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 16px rgba(0,0,0,0.6);
}
body.dark-mode .schedule-popover .arrow { border-top-color: #2b2b2b; }
body.dark-mode .schedule-popover .sched-row .left,
body.dark-mode .schedule-popover .sched-row .right { color: #aaa; }

body.dark-mode .calc-content { background: #2b2b2b; color: #ddd; }
body.dark-mode .calc-rate { color: #66aaff; }
body.dark-mode .calc-direction select,
body.dark-mode #calc-amount { background: #3a3a3a; border-color: #555; color: #fff; }

body.dark-mode .exchange-info h2 { color: #cce6ff; border-color: #4d9eff; }
body.dark-mode .exchange-info h3 { color: #e0e0e0; }
body.dark-mode .exchange-card { background: #2b2b2b; border-color: #444; color: #ddd; }
body.dark-mode .exchange-card:hover { box-shadow: 0 4px 12px rgba(255,255,255,0.1); }
body.dark-mode .exchange-card .icon { color: #66aaff; }
body.dark-mode .disclaimer {
  background: #242b34;
  border-left-color: #4d9eff;
  color: #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
body.dark-mode .disclaimer h2 { color: #cce6ff; }
body.dark-mode .disclaimer p  { color: #e0e0e0; }
body.dark-mode .header-subtitle { color: #e0e0e0; }
body.dark-mode .exchange-card p { color: #e0e0e0; }
.rate-cell {
  cursor: pointer;                 /* 👈 восстановили указатель */
  transition: color 0.2s, transform 0.15s;
}

.rate-cell:hover {
  color: #007bff;
  transform: scale(1.1);
}

body.dark-mode .rate-cell:hover {
  color: #66aaff;
}
/* === Ввод в калькуляторе: выравнивание placeholder === */ 
#calc-amount::placeholder { 
	text-align: left; 
	color: #888; 
} 
/* --- анимация появления --- */ 
@keyframes fadeIn { 
	from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* --- Предупреждающий текст внутри карточек --- */
.warning-text {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

/* --- Тёмная тема --- */
body.dark-mode .warning-text {
  color: #f2d98b; /* мягкий тёплый оттенок для тёмного фона */
}