/* ================================================
   LANGUAGE MODAL STYLES
   Mobile-First Fullscreen Modal for Language Selection
   ================================================ */

/* Trigger Button */
.lang-trigger-modern {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  /* background: white; */ /* Überschrieben durch main.css */
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-trigger-modern:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lang-trigger-modern #currentFlag {
  font-size: 20px;
  line-height: 1;
}

.lang-trigger-modern #currentLangCode {
  font-weight: 700;
  color: #1e293b;
}

/* Modal Overlay */
.language-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.language-modal.active {
  display: block;
}

/* Backdrop */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

/* Modal Container */
.modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: white;
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Desktop: Centered Modal */
@media (min-width: 768px) {
  .modal-container {
    width: 90%;
    max-width: 600px;
    height: auto;
    max-height: 80vh;
    margin: 10vh auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Modal Body */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  -webkit-overflow-scrolling: touch;
}

/* Language Grid */
.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .language-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Language Item */
.lang-item-modal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #1e293b;
}

.lang-item-modal:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.lang-item-modal.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea15, #764ba215);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.lang-item-modal .flag {
  font-size: 28px;
  line-height: 1;
}

.lang-item-modal .lang-info {
  flex: 1;
  min-width: 0;
}

.lang-item-modal .lang-name {
  font-weight: 600;
  font-size: 15px;
  display: block;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-item-modal .lang-code {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
}

.lang-item-modal .checkmark {
  display: none;
  color: #667eea;
  font-size: 20px;
  font-weight: 700;
}

.lang-item-modal.active .checkmark {
  display: block;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  @keyframes slideUp {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  .lang-trigger-modern {
    top: 16px;
    right: 16px;
    padding: 8px 12px;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .lang-item-modal {
    padding: 14px;
  }
}
