/* Font Switcher Widget Styles */

/* Nithya Ranjana font definitions */
@font-face {
  font-family: 'NithyaRanjana';
  src:  url('https://cdn.staticdelivr.com/gh/callijatra/nithya-ranjana-webfont1/main/fonts/NithyaRanjanaDU-Regular.otf') format('otf'),
        url('https://cdn.staticdelivr.com/gh/callijatra/nithya-ranjana-webfont1/main/fonts/NithyaRanjanaDU-Regular.woff2') format('woff2'),
        url('https://cdn.staticdelivr.com/gh/callijatra/nithya-ranjana-webfont1/main/fonts/NithyaRanjanaDU-Regular.woff') format('woff');
  font-weight: 100;
  font-display: swap;
}
/* Nepa Aakha font */
@font-face {
  font-family: 'NewaAakha';
  src:  url('https://cdn.staticdelivr.com/gh/dibeshpradhan/newa-font-switch-widget/main/demo/font/NEPAL%20AAKHA.otf') format('otf'),
        url('https://cdn.staticdelivr.com/gh/dibeshpradhan/newa-font-switch-widget/main/demo/font/NEPAL%20AAKHA.woff') format('woff'),
        url('https://cdn.staticdelivr.com/gh/dibeshpradhan/newa-font-switch-widget/main/demo/font/NEPAL%20AAKHA.woff2') format('woff2');
  font-weight: 100;
  font-display: swap;
}
/* Noto Sans Newa is loaded via Google Fonts link in JavaScript */

/* Widget container - base styles */
.font-switcher-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Fixed positioning (default - top-right corner) */
.font-switcher-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Inline placement (when inserted into a custom container) */
.font-switcher-inline {
  position: relative;
  display: inline-flex;
  box-shadow: none;
  flex-shrink: 0; /* Prevent shrinking in flex containers */
}

/* Widget label */
.font-switcher-label {
  color: #333;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

/* Custom dropdown */
.font-switcher-dropdown {
  position: relative;
  min-width: 260px;
}

.font-switcher-selected {
  padding: 6px 28px 6px 10px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #ffffff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.font-switcher-selected::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-top-color: #666;
}

.font-switcher-open .font-switcher-selected::after {
  border-top-color: transparent;
  border-bottom-color: #666;
  transform: translateY(-80%);
}

.font-switcher-selected:hover {
  border-color: #999;
}

.font-switcher-dropdown:focus .font-switcher-selected {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.font-switcher-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  overflow: hidden;
}

.font-switcher-open .font-switcher-options {
  display: block;
}

.font-switcher-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  gap: 12px;
}

.font-switcher-option:hover {
  background: #f0f4ff;
}

.font-switcher-option-active {
  background: #e8f0fe;
}

.font-switcher-option-name {
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}

.font-switcher-option-preview {
  font-size: 16px;
  color: #555;
  white-space: nowrap;
}

/* Font utility classes (for manual application if needed) */
.font-switcher-ranjana {
  font-family: 'NithyaRanjana', sans-serif !important;
}

.font-switcher-newa {
  font-family: 'NewaAakha', sans-serif !important;
}

.font-switcher-notoNewa {
  font-family: 'Noto Sans Newa', sans-serif !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .font-switcher-fixed {
    top: 10px;
    right: 10px;
  }

  .font-switcher-container {
    padding: 6px 10px;
    font-size: 13px;
  }

  .font-switcher-dropdown {
    min-width: 200px;
  }

  .font-switcher-selected {
    padding: 5px 24px 5px 8px;
    font-size: 13px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .font-switcher-container {
    border-width: 2px;
    border-color: #000;
  }

  .font-switcher-selected {
    border-width: 2px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .font-switcher-container {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
  }

  .font-switcher-label {
    color: #e0e0e0;
  }

  .font-switcher-selected {
    background: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
  }

  .font-switcher-selected:hover {
    border-color: #777;
  }

  .font-switcher-selected::after {
    border-top-color: #aaa;
  }

  .font-switcher-options {
    background: #2d2d2d;
    border-color: #555;
  }

  .font-switcher-option:hover {
    background: #3a3a3a;
  }

  .font-switcher-option-active {
    background: #404040;
  }

  .font-switcher-option-name {
    color: #e0e0e0;
  }

  .font-switcher-option-preview {
    color: #ccc;
  }
}

