/*------------------------------------------------------------------------
# AA Smart Accessibility
# ------------------------------------------------------------------------
# author    AA Extensions https://aaextensions.com
# Copyright (C) 2018 AA Extensions. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: https://aaextensions.com
-------------------------------------------------------------------------*/

/* Mobile First Design */
@media (max-width: 768px) {
  .fr-toggle-text,
  .fr-toggle-badge {
    display: none;
  }
  
  .fr-toggle {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  
  .fr-toggle-icon {
    font-size: 26px;
  }
  
  .fr-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    bottom: -100%;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .fr-panel.active {
    bottom: 0;
    display: flex;
    animation: slideUpMobile 0.3s ease;
  }
  
  @keyframes slideUpMobile {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
  
  .fr-panel-header {
    padding: 16px;
    cursor: pointer;
  }
  
  .fr-panel-content {
    max-height: 60vh;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mobile scrollbar adjustments */
  .fr-panel-content::-webkit-scrollbar {
    width: 6px;
  }
  
  .fr-scrollbar-rounded .fr-panel-content::-webkit-scrollbar {
    width: 8px;
  }
  
  .fr-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .fr-btn {
    padding: 12px;
    font-size: 13px;
    min-height: 44px;
  }
  
  .fr-btn-group {
    gap: 8px;
  }
  
  .fr-section {
    margin-bottom: 20px;
  }
  
  .fr-section h4 {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  body.fr-panel-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
  
  .fr-settings-panel {
    margin-bottom: 16px;
  }
  
  .fr-toggle-options {
    gap: 8px;
  }
  
  .fr-option-item {
    padding: 6px;
  }
  
  .fr-panel-footer {
    flex-direction: column;
    gap: 8px;
  }
  
  .fr-show-settings {
    font-size: 10px;
  }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
  .fr-toggle {
    width: auto;
    min-width: 52px;
    height: 52px;
    padding: 0 16px;
  }
  
  .fr-toggle-text {
    font-size: 13px;
  }
  
  .fr-panel {
    width: 360px;
    max-width: 90vw;
  }
  
  .fr-panel-content {
    max-height: 65vh;
  }
  
  .fr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
  .fr-panel-content {
    max-height: 50vh;
  }
  
  .fr-section {
    margin-bottom: 12px;
  }
  
  .fr-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .fr-panel-content {
    max-height: 55vh;
    padding: 14px;
  }
  
  .fr-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .fr-btn {
    padding: 10px;
    font-size: 12px;
  }
  
  .fr-section h4 {
    font-size: 12px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .fr-btn:active {
    transform: scale(0.96);
  }
  
  .fr-toggle:active {
    transform: scale(0.96);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .fr-toggle,
  .fr-panel,
  .fr-btn,
  .fr-close,
  .fr-settings-panel {
    transition: none;
    animation: none;
  }
  
  .fr-toggle-pulse,
  .fr-toggle-ripple,
  .fr-toggle-glow,
  .fr-toggle-bounce {
    animation: none;
  }
}

/* Print Styles */
@media print {
  .fr-toggle,
  .fr-panel {
    display: none !important;
  }
}

/* Accessibility Focus */
.fr-toggle:focus-visible,
.fr-btn:focus-visible,
.fr-close:focus-visible,
.fr-settings-toggle:focus-visible,
.fr-show-settings:focus-visible {
  outline: 3px solid var(--fr-primary);
  outline-offset: 2px;
}

/* Smooth Scrolling */
.fr-panel-content {
  scroll-behavior: smooth;
}