/**
 * PCMA Isotopes Database - Main Application Styles
 *
 * @author Nika Chavleishvili
 * @copyright 2026 Nika Chavleishvili
 * @license MIT
 *
 * Modern Minimalistic Design - Apple Inspired
 * Modular CSS files are imported in app.js
 */

/* Language Switcher - Visible and Optimized for 3 Languages */
.language-switcher-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  contain: layout style paint;
}

.language-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.875rem;
  min-width: 45px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: none;
  white-space: nowrap;
  z-index: 2;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.language-toggle-btn:hover {
  color: white;
}

.language-toggle-btn.active {
  color: white;
  font-weight: 700;
}

.language-toggle-slider {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  bottom: 0.25rem;
  width: calc(33.333% - 0.167rem);
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.language-switcher-toggle:hover .language-toggle-slider {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Slider positions for each language */
[data-language-switcher-current-locale-value="en"] .language-toggle-slider {
  transform: translate3d(0, 0, 0);
}

[data-language-switcher-current-locale-value="pl"] .language-toggle-slider {
  transform: translate3d(100%, 0, 0);
}

[data-language-switcher-current-locale-value="ar"] .language-toggle-slider {
  transform: translate3d(200%, 0, 0);
}

@media (max-width: 576px) {
  .language-toggle-btn {
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    font-size: 0.75rem;
  }
}

/* ========== FILTER COLLAPSE - Custom Implementation ========== */
/* We use a custom .filter-collapse class instead of Bootstrap's .collapse */
/* to avoid conflicts between Bootstrap JS and our Stimulus controller */
/* See forms.css for the .filter-collapse styles */

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
/* Only apply to interactive elements, not all elements */
button,
.btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Dropdown - minimal GPU hints, only when needed */
.dropdown-menu.show {
  transform: translateZ(0);
}