/**
 * Footer Styles
 * 
 * @package Nordlysvarsel\Footer
 * @since 1.0.0
 */

/* Hide old toolbar and modal system */
.nsgla-toolbar,
.nsgla-modal-bg {
  display: none !important;
}

/* Footer bar */
.nlsvk-footer-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: #101820;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.45);
  z-index: 9999;
  color: #e6eef6;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Ensure body has padding at bottom so content doesn't hide behind footer */
body {
  padding-bottom: 60px;
}

.nlsvk-footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
  flex-wrap: nowrap;
}

.nlsvk-footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.nlsvk-footer-brand {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.nlsvk-footer-loc {
  font-size: 13px;
  color: #FF5733;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.nlsvk-footer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.nlsvk-footer-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e6eef6;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nlsvk-footer-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nlsvk-footer-btn i {
  font-size: 18px;
  line-height: 1;
  display: block;
}

.nlsvk-footer-btn__badge {
  position: relative;
}

.nlsvk-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nlsvk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nlsvk-footer-btn i[data-icon="close"] {
  display: none;
}

/* Settings panel - slides up like alerts */
.nlsvk-settings-standalone {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 60px;
  background: #161616;
  border-top: none;
  padding: 0;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(calc(100% + 60px));
  transition: transform 0.3s ease;
  z-index: 998;
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.45);
  overscroll-behavior: contain;
  border-radius: 12px 12px 0 0;
}

.nlsvk-settings-standalone.open {
  transform: translateY(0);
}

.nlsvk-settings-standalone__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  background: #101820;
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nlsvk-settings-standalone__title {
  font-size: 16px;
  font-weight: 700;
  color: #e6eef6;
  margin: 0;
}

.nlsvk-settings-standalone__close {
  background: rgba(255, 255, 255, 0.08);
  color: #e6eef6;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}

.nlsvk-settings-standalone__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nlsvk-settings-standalone__content {
  padding: 14px;
}

/* Settings sections */
.nlsvk-settings__section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nlsvk-settings__section:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.nlsvk-settings__intro p {
  margin: 0 0 10px;
  line-height: 1.6;
}

.nlsvk-settings__intro p:last-child {
  margin-bottom: 0;
}

.nlsvk-settings__intro-bold {
  font-weight: 700;
  font-size: 14px;
  color: inherit;
  margin: 0 0 10px;
  line-height: 1.6;
}

.nlsvk-settings__section h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.nlsvk-settings__hint {
  margin: 0 0 8px;
  font-size: 14px;
  color: #9bb0bf;
  line-height: 1.5;
}

/* Location help text */
.nlsvk-settings__location-help {
  font-size: 13px;
  color: #9bb0bf;
  margin: 0 0 10px;
  line-height: 1.5;
}

.nlsvk-settings__location-help .location-name {
  color: #FF5733;
  font-weight: 600;
}

/* Input group with button */
.nlsvk-settings__input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.nlsvk-settings__input-group input {
  flex: 1;
  min-height: 42px;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e6eef6;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.nlsvk-settings__input-group input:focus {
  outline: none;
  border-color: rgba(255, 87, 51, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 87, 51, 0.1);
}

.nlsvk-settings__input-group input::placeholder {
  color: #66788a;
}

.nlsvk-settings__clear-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e6eef6;
  font-size: 16px;
}

.nlsvk-settings__clear-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
  transform: rotate(90deg);
}

/* Legacy - no longer used but kept for compatibility */
.nlsvk-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Legacy styles - kept for backwards compatibility */
.nlsvk-settings__actions input {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 42px;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e6eef6;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.nlsvk-settings__actions button {
  background: rgba(255, 255, 255, 0.08);
  color: #e6eef6;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 42px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nlsvk-settings__actions button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.nlsvk-settings__results {
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  gap: 4px;
  background: #161616;
  margin-top: 10px;
}

.nlsvk-settings__results div {
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e6eef6;
  font-size: 14px;
  line-height: 1.4;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.nlsvk-settings__results div:hover {
  background: rgba(255, 87, 51, 0.12);
  color: #FF5733;
  transform: translateX(4px);
}

.nlsvk-settings__status {
  font-size: 13px;
  color: #9bb0bf;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.5;
}

.nlsvk-settings__status:empty {
  display: none;
}

.nlsvk-settings__status.success {
  color: #FF5733;
  background: rgba(255, 87, 51, 0.1);
  border: 1px solid rgba(255, 87, 51, 0.2);
}

.nlsvk-settings__status.success::before {
  content: '✓ ';
  font-weight: bold;
}

.nlsvk-settings__status.error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.nlsvk-settings__status.error::before {
  content: '⚠ ';
  font-weight: bold;
}

.nlsvk-settings__status.info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nlsvk-settings__status.info::before {
  content: 'ℹ ';
  font-weight: bold;
}

.nlsvk-settings__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #e6eef6;
  margin-bottom: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nlsvk-settings__toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nlsvk-settings__toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nlsvk-settings__toggle input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e6eef6;
  left: 2px;
  top: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nlsvk-settings__toggle input[type="checkbox"]:checked {
  background: #10b981;
  border-color: #10b981;
}

.nlsvk-settings__toggle input[type="checkbox"]:checked::before {
  left: 24px;
}

.nlsvk-settings__toggle span {
  font-weight: 500;
  user-select: none;
}

#nlsvk-settings-alert-label .location-name {
  color: #FF5733;
  font-weight: 600;
}

/* Install section styling */
.nlsvk-settings__section--install {
  padding-top: 8px;
}

.nlsvk-install-cta {
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 12px;
}

.nlsvk-settings__install-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  width: 100%;
  background: #101820 !important;
  border: 1px solid #34495E30 !important;
  border-radius: 13px !important;
  padding: .86em 1.48em !important;
  font-weight: 600 !important;
  line-height: 1.14 !important;
  color: #e6eef6 !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.22), 0 1px 0 rgba(255,255,255,.03) inset !important;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.nlsvk-settings__install-btn::before {
  content: '📱';
  font-size: 18px;
}

.nlsvk-settings__install-btn:hover {
  background: #1a2530 !important;
  border-color: #34495E50 !important;
}

.nlsvk-settings__install-btn:active {
  transform: scale(0.98);
}

.nlsvk-settings__install-hint {
  margin-top: 12px;
  font-size: 13px;
  color: #9bb0bf;
  line-height: 1.5;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .nlsvk-settings-standalone {
    bottom: 56px;
    max-height: 70vh;
  }
  
  .nlsvk-settings__actions {
    flex-direction: column;
  }
  
  .nlsvk-settings__actions input {
    flex: 1;
    width: 100%;
  }
}

/* Hide old panel system */
.nlsvk-footer-panel {
  display: none !important;
}
