/* ===== UNIFIED SEARCH & LANGUAGE MODAL ===== */

.unified-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.unified-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.unified-modal {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9) translateY(30px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.unified-modal-overlay.active .unified-modal {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #6c757d;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--brand-primary-color);
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tab-btn i {
  font-size: 1rem;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #6c757d;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #dc3545;
  color: white;
  transform: rotate(90deg);
}

/* Modal Content */
.modal-content {
  padding: 2rem;
  max-height: calc(80vh - 100px);
  overflow-y: auto;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SEARCH TAB STYLES ===== */

.search-section {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 3rem;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  font-size: 1.1rem;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-color-rgb), 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 1.1rem;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #6c757d;
  color: white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.search-clear:hover {
  background: #dc3545;
  transform: translateY(-50%) scale(1.1);
}

.search-input:not(:placeholder-shown) + .search-clear {
  display: flex;
}

/* Search Results */
.search-results {
  min-height: 200px;
}

.search-suggestions h4 {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.suggestion-tag {
  padding: 0.6rem 1.2rem;
  border: 1px solid #dee2e6;
  border-radius: 25px;
  background: white;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.suggestion-tag:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== LANGUAGE TAB STYLES ===== */

.language-section h3 {
  color: #333;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.language-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border: 2px solid #e9ecef;
  border-radius: 15px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.language-option:hover {
  border-color: #667eea;
  background: #f8f9fa;
  transform: translateX(5px);
}

.language-option.active {
  border-color: #28a745;
  background: #f8fff9;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.lang-flag {
  font-size: 2rem;
  width: 40px;
  text-align: center;
}

.lang-details {
  flex-grow: 1;
  text-align: left;
}

.lang-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.2rem;
}

.lang-native {
  display: block;
  font-size: 0.9rem;
  color: #6c757d;
}

.lang-check {
  color: #28a745;
  font-size: 1.2rem;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.language-option.active .lang-check {
  opacity: 1;
  transform: scale(1);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .unified-modal {
    width: 95%;
    max-width: none;
    margin: 1rem;
    max-height: 90vh;
  }

  .modal-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .modal-tabs {
    justify-content: center;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 1rem;
  }

  .modal-close {
    align-self: center;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .search-input {
    font-size: 1rem;
  }

  .suggestion-tags {
    justify-content: center;
  }

  .language-option {
    padding: 0.8rem 1rem;
  }

  .lang-flag {
    font-size: 1.5rem;
    width: 30px;
  }
}

@media (max-width: 480px) {
  .unified-modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .tab-btn span {
    display: none;
  }

  .tab-btn {
    padding: 0.6rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    justify-content: center;
  }

  .modal-header {
    padding: 1rem;
  }
}

/* ===== ENHANCED SEARCH RESULTS STYLING ===== */

/* Search Loading State */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #6c757d;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e9ecef;
  border-top: 3px solid linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Search Results List */
.search-results-list {
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background-color: #f8f9fa;
  border-left: 4px solid #007bff;
  padding-left: calc(1.5rem - 4px);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Result Header */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.result-category {
  font-size: 0.75rem;
  color: #007bff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-score {
  font-size: 0.7rem;
  color: #6c757d;
  background: #e9ecef;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

/* Result Content */
.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.result-description {
  font-size: 0.875rem;
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Matched Terms */
.result-matched-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.matched-term {
  font-size: 0.75rem;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
  border: 1px solid #90caf9;
}

/* Search Header */
.search-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.search-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: #212529;
  font-weight: 600;
}

/* Search Footer */
.search-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  text-align: center;
}

.search-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.search-view-all:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* No Results State */
.search-no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: #6c757d;
}

.search-no-results i {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.search-no-results h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: #495057;
}

.search-no-results p {
  margin: 0;
  font-size: 0.875rem;
}

/* Error State */
.search-error {
  text-align: center;
  padding: 3rem 2rem;
  color: #dc3545;
}

.search-error i {
  font-size: 3rem;
  color: #f8d7da;
  margin-bottom: 1rem;
}

.search-error h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: #721c24;
}

.search-error p {
  margin: 0;
  font-size: 0.875rem;
  color: #856404;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .search-result-item {
    padding: 0.875rem 1rem;
  }
  
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .result-title {
    font-size: 0.9rem;
  }
  
  .result-description {
    font-size: 0.8rem;
  }
  
  .matched-term {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .search-header,
  .search-footer {
    padding: 0.875rem 1rem;
  }
}