/**
 * Enhanced Aircheck Library CSS
 * 
 * Additional styles for enhanced functionality including
 * animations, transitions, and improved user experience.
 *
 * @package MagoneEnhanced
 * @version 1.0.0
 */

/* ==========================================================================
   ENHANCED SEARCH AND FILTERING
   ========================================================================== */

.aircheck-search-container {
    position: relative;
    transition: all 0.3s ease;
}

.aircheck-search-container.loading {
    opacity: 0.8;
    pointer-events: none;
}

.search-button {
    position: relative;
    overflow: hidden;
}

.search-button .search-text {
    transition: opacity 0.3s ease;
}

.search-button.loading .search-text {
    opacity: 0;
}

.search-button .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced form controls */
.sort-group select:focus {
    outline: 2px solid #AC2125;
    outline-offset: 2px;
}

.filter-group select:focus {
    outline: 2px solid #AC2125;
    outline-offset: 2px;
}

/* ==========================================================================
   ENHANCED ALPHABET NAVIGATION
   ========================================================================== */

.alphabet-btn {
    position: relative;
    overflow: hidden;
}

.alphabet-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.alphabet-btn:hover::after,
.alphabet-btn:focus::after {
    width: 60px;
    height: 60px;
}

.alphabet-btn:active {
    transform: translateY(-2px) scale(0.95);
}

.alphabet-btn.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Count badges for alphabet buttons */
.alphabet-btn[data-count="0"]:not([data-letter="all"]) {
    opacity: 0.4;
    cursor: not-allowed;
}

.alphabet-btn[data-count="0"]:not([data-letter="all"]):hover {
    transform: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #555;
    border-color: #ddd;
    box-shadow: none;
}

/* ==========================================================================
   ENHANCED AIRCHECK ITEMS
   ========================================================================== */

.aircheck-item {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aircheck-item.playing {
    border-color: #AC2125;
    box-shadow: 0 4px 20px rgba(172, 33, 37, 0.2);
    background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
}

.aircheck-item.playing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #AC2125 0%, #8A1B1E 100%);
    border-radius: 0 2px 2px 0;
}

.aircheck-item.in-queue {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff8 0%, #eafef0 100%);
}

.aircheck-item.in-queue::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 10px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

/* Enhanced button states */
.audio-control-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.audio-control-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(172, 33, 37, 0.3);
    border-top: 2px solid #AC2125;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    z-index: 2;
}

.audio-control-btn.loading img {
    opacity: 0.3;
}

/* ==========================================================================
   FILTERING AND ANIMATION STATES
   ========================================================================== */

.aircheck-item.filtered-out {
    display: none !important;
    opacity: 0;
    transform: translateY(-20px);
}

.aircheck-item.fade-in {
    animation: fadeInUp 0.5s ease-out;
}

.aircheck-item.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   RESULTS AND STATUS DISPLAYS
   ========================================================================== */

.aircheck-results-info {
    margin: 20px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 8px;
    border-left: 4px solid #AC2125;
    font-weight: 500;
    color: #333;
}

.results-count {
    display: inline-block;
    transition: all 0.3s ease;
}

.results-count.updating {
    opacity: 0.6;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    margin: 30px 0;
}

.no-results h3 {
    color: #6c757d;
    font-size: 24px;
    margin-bottom: 15px;
}

.no-results p {
    color: #868e96;
    font-size: 16px;
    margin-bottom: 25px;
}

.no-results .button {
    display: inline-block;
    background: linear-gradient(135deg, #AC2125 0%, #8A1B1E 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.no-results .button:hover {
    background: linear-gradient(135deg, #8A1B1E 0%, #761618 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(172, 33, 37, 0.3);
    color: white;
}

/* ==========================================================================
   NOW PLAYING DISPLAY
   ========================================================================== */

#now-playing-display {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #AC2125 0%, #8A1B1E 100%);
    color: white;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(172, 33, 37, 0.3);
    animation: slideInDown 0.5s ease-out;
}

#now-playing-display strong {
    margin-right: 10px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   ENHANCED PAGINATION
   ========================================================================== */

.aircheck-pagination {
    margin: 40px 0;
    text-align: center;
}

.aircheck-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: #ffffff;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.aircheck-pagination .page-numbers:hover,
.aircheck-pagination .page-numbers.current {
    background: linear-gradient(135deg, #AC2125 0%, #8A1B1E 100%);
    border-color: #AC2125;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(172, 33, 37, 0.3);
}

.aircheck-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.aircheck-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #333;
}

/* ==========================================================================
   CLEAR FILTERS
   ========================================================================== */

.clear-filters {
    margin-top: 20px;
    text-align: center;
}

.clear-button {
    display: inline-block;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    color: white;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
}

#aircheck-loading {
    display: none;
    text-align: center;
    padding: 30px;
}

#aircheck-loading.show {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #AC2125;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* ==========================================================================
   RESPONSIVE ENHANCEMENTS
   ========================================================================== */

@media (max-width: 768px) {
    .aircheck-results-info {
        margin: 15px 0;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    #now-playing-display {
        position: static;
        margin-bottom: 15px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .no-results {
        padding: 40px 20px;
    }
    
    .no-results h3 {
        font-size: 20px;
    }
    
    .no-results p {
        font-size: 14px;
    }
    
    .clear-button {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .aircheck-pagination .page-numbers {
        padding: 8px 12px;
        margin: 0 3px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .aircheck-results-info {
        margin: 12px 0;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .no-results {
        padding: 30px 16px;
    }
    
    .no-results h3 {
        font-size: 18px;
    }
    
    .no-results p {
        font-size: 13px;
    }
    
    .aircheck-pagination .page-numbers {
        padding: 6px 10px;
        margin: 0 2px;
        font-size: 13px;
    }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.alphabet-btn:focus,
.audio-control-btn:focus,
.search-button:focus,
.clear-button:focus,
.page-numbers:focus {
    outline: 3px solid #AC2125;
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .alphabet-btn,
    .audio-control-btn,
    .aircheck-item {
        border-width: 3px;
    }
    
    .alphabet-btn:hover,
    .alphabet-btn.active {
        border-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .aircheck-item::before,
    .alphabet-btn::after,
    .audio-control-btn::before {
        display: none !important;
    }
}

/* Print styles */
@media print {
    .alphabet-btn,
    .search-button,
    .clear-button,
    .audio-control-btn,
    #now-playing-display,
    .loading-spinner {
        display: none !important;
    }
    
    .aircheck-item {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #000;
        padding: 15px;
    }
    
    .aircheck-title-display a {
        color: #000 !important;
        text-decoration: underline;
    }
}