/* ===== Shared layout: navbar, lang switcher, top-up, toast, footer ===== */

/* ---------- Header / navbar ---------- */
.navbar-header {
  background: linear-gradient(135deg, #0168fa 0%, #3a7bd5 100%);
  box-shadow: 0 2px 10px rgba(1, 104, 250, 0.25);
  border-bottom: none;
}
.navbar-header .df-logo,
.navbar-header .df-logo:hover {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.navbar-header .df-logo span { color: #fff; }
.logo-bbs {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0px;
  color: #fff;
}
.navbar-header .logo-icon {
  margin-right: 7px;
  vertical-align: -3px;
  color: #fff;
}
.navbar-header .logo-word-black {
  display: inline-block;
  padding: 2px 7px 3px;
  margin: 0 -2px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  line-height: 1;
}

.navbar-email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  color: rgba(255, 255, 255, .8) !important;
}
.navbar-right {
  flex-shrink: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: auto !important;
}
.navbar-balance {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .15);
  border-radius: 20px;
  padding: 4px 14px;
  margin-right: 10px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.navbar-balance .balance-label {
  color: rgba(255, 255, 255, .7);
  margin-right: 4px;
}
.navbar-balance .balance-amount {
  color: #fff;
  font-weight: 600;
}

.btn-topup {
  background: #fff;
  color: #0168fa;
  border: none;
  font-weight: 600;
  border-radius: 20px;
  padding: 5px 18px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-topup:hover {
  background: rgba(255, 255, 255, .9);
  color: #0150c7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.navbar-signout {
  color: rgba(255, 255, 255, .7) !important;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s;
}
.navbar-signout:hover { color: #fff !important; }

.signout-text { display: inline; }

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; }
.lang-current {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .12);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}
.lang-current:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  text-decoration: none;
}
.lang-code { letter-spacing: 0.5px; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
  padding: 4px 0;
  z-index: 1050;
  animation: fadeSlideIn 0.15s ease;
}
.lang-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 16px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  border-left: 1px solid rgba(0,0,0,0.08);
  transform: rotate(45deg);
  z-index: 0;
}
.lang-option {
  display: block;
  padding: 8px 16px;
  color: #596882;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
  z-index: 1;
}
.lang-option:hover {
  background: #f5f6fa;
  color: #1b2e4b;
  text-decoration: none;
}
.lang-option.active {
  color: #0168fa;
  font-weight: 600;
}

/* ---------- Top Up dropdown ---------- */
.topup-wrap { position: relative; }
.topup-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
  padding: 15px;
  z-index: 1050;
  animation: fadeSlideIn 0.15s ease;
}
.topup-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, .05);
}
.topup-header { color: #1b2e4b; }
.topup-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.topup-preset {
  border-radius: 4px;
  font-weight: 600;
  padding: 4px 0;
}
.topup-preset.active {
  background: #0168fa;
  color: #fff;
  border-color: #0168fa;
}
.topup-dropdown .input-group-text {
  background: #f5f6fa;
  border-color: #d0d7e0;
  font-size: 12px;
}
.topup-dropdown .form-control {
  border-color: #d0d7e0;
  font-size: 14px;
}

/* ---------- Loading button + spinner ---------- */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  display: flex;
  align-items: center;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  font-size: 14px;
  color: #1b2e4b;
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  border-left: 4px solid #0168fa;
}
.toast-item.toast-success { border-left-color: #10b759; }
.toast-item.toast-warning { border-left-color: #f59f00; }
.toast-item.toast-error   { border-left-color: #dc3545; }
.toast-item.toast-info    { border-left-color: #0168fa; }
.toast-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  flex-shrink: 0;
}
.toast-item.toast-success .toast-icon { color: #10b759; }
.toast-item.toast-warning .toast-icon { color: #f59f00; }
.toast-item.toast-error   .toast-icon { color: #dc3545; }
.toast-item.toast-info    .toast-icon { color: #0168fa; }
.toast-text { flex-grow: 1; line-height: 1.4; }
.toast-close {
  background: none;
  border: none;
  color: #7e8da2;
  font-size: 18px;
  line-height: 1;
  margin-left: 10px;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toast-close:hover { color: #1b2e4b; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast-item.toast-out { animation: toastOut 0.2s ease forwards; }
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ---------- Footer ---------- */
.content-fixed { margin-top: 0 !important; }
.footer { display: block !important; font-size: 12px !important; }
.footer a { color: #637388; text-decoration: none; transition: color 0.15s; }
.footer a:hover { color: #0168fa; text-decoration: none; }

.fv2-contacts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}
.fv2-contacts svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.fv2-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #7e8da2;
}
.fv2-bottom a { color: #7e8da2; }
.fv2-bottom a:hover { color: #0168fa; }
.fv2-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c0c6d0;
}

/* ---------- Logo short/full ---------- */
.logo-short { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .navbar-email { max-width: 150px; }
  .signout-text { display: none; }
}
@media (max-width: 849px) {
  .logo-full { display: none !important; }
  .logo-short { display: inline !important; }
}
@media (max-width: 767px) {
  .fv2-contacts { flex-direction: column; gap: 6px; }
  .navbar-balance .balance-label { display: none; }
  .navbar-email { max-width: 100px; }
  .btn-topup { padding: 4px 12px; font-size: 12px; }
}
@media (max-width: 575px) {
  .navbar-email { max-width: 70px; }
  .navbar-balance { padding: 3px 10px; }
  .lang-switch { margin-left: 10px; }
  .lang-current { padding: 4px 8px; }
}

/* Discount badge on duration preset buttons */
.preset-discount {
  position: absolute;
  top: -10px;
  right: -4px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: #10b759;
  padding: 1px 4px;
  border-radius: 5px;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
}
