/**
 * FAL Digital Language Modal Styles
 * Shared modal component styling
 */

/* Modal overlay and container */
.fal-lang-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fal-lang-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.fal-lang-modal-dialog {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Header */
.fal-lang-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
}

.fal-lang-modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
}

.fal-lang-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.fal-lang-modal-close:hover {
  background-color: #f0f0f0;
  color: #000;
}

.fal-lang-modal-close:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Body */
.fal-lang-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Search */
.fal-lang-modal-search {
  margin-bottom: 1rem;
}

.fal-lang-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.fal-lang-search-input:focus {
  outline: none;
  border-color: #0066cc;
}

/* Language list */
.fal-lang-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.fal-lang-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.fal-lang-item:hover {
  border-color: #0066cc;
  background-color: #f8f9ff;
}

.fal-lang-item:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.fal-lang-item-current {
  border-color: #0066cc;
  background-color: #e6f2ff;
  font-weight: 600;
}

.fal-lang-item-flag {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.fal-lang-item-native {
  font-size: 1rem;
  color: #1a1a1a;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fal-lang-item-label {
  font-size: 0.875rem;
  color: #666;
  flex-shrink: 0;
}

/* Language button (replaces dropdown) */
.fal-lang-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.fal-lang-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.fal-lang-button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.fal-lang-button-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.fal-lang-button-text {
  font-weight: 500;
}

/* Dark header variant (for marketing pages) */
.site-header .fal-lang-button {
  color: #e5e7eb;
  border-color: rgba(229, 231, 235, 0.3);
}

.site-header .fal-lang-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(229, 231, 235, 0.5);
  color: #ffffff;
}

/* App header variant (matches app-header-select styling) */
.app-header .fal-lang-button {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  min-width: 120px;
  max-width: 200px;
}

.app-header .fal-lang-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.app-header .fal-lang-button:focus {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.app-header .fal-lang-button.app-header-link {
  /* When used as app-header-link, match that styling */
  background: transparent;
  border: none;
  padding: 0;
  min-width: auto;
  max-width: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .fal-lang-modal-dialog {
    width: 95%;
    max-height: 90vh;
  }

  .fal-lang-modal-list {
    grid-template-columns: 1fr;
  }

  .fal-lang-item-label {
    display: none;
  }

  .fal-lang-button-text {
    display: none;
  }

  .fal-lang-button {
    padding: 0.5rem;
    min-width: 44px;
    justify-content: center;
  }
}

/* RTL support */
[dir="rtl"] .fal-lang-modal-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .fal-lang-item {
  flex-direction: row-reverse;
}

