/* Jukebox5D Utility Classes - Bootstrap Extensions */

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

/* Container Utilities */
.container-mobile {
    max-width: 500px;
    margin: 0 auto;
}

/* Flexbox Utilities (extending Bootstrap) */
.d-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.d-flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ========================================
   SPACING UTILITIES
   ======================================== */

/* Gap utilities (for browsers that don't support gap in flexbox) */
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 3rem; }

/* ========================================
   BACKGROUND UTILITIES
   ======================================== */

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #1874CD) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
}

/* Glass Effect Backgrounds */
.bg-glass {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bg-glass-dark {
    background: rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-glass-white {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
}

/* ========================================
   BORDER UTILITIES
   ======================================== */

/* Border Radius */
.rounded-xl { border-radius: 1rem !important; }
.rounded-xxl { border-radius: 1.5rem !important; }
.rounded-pill-custom { border-radius: 50px !important; }
.rounded-pill{border-radius: 11px !important;}

/* Border Colors */
.border-primary-light { border-color: rgba(30, 144, 255, 0.3) !important; }
.border-white-light { border-color: rgba(255, 255, 255, 0.3) !important; }

/* ========================================
   TEXT UTILITIES
   ======================================== */

/* Text Colors with opacity */
.text-primary-light { color: rgba(30, 144, 255, 0.7) !important; }
.text-white-light { color: rgba(255, 255, 255, 0.8) !important; }
.text-dark-light { color: rgba(0, 0, 0, 0.7) !important; }

/* Text Effects */
.text-gradient-primary {
    background: linear-gradient(135deg, #1E90FF, #1874CD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-dark {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   SHADOW UTILITIES
   ======================================== */

.shadow-xs { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important; }
.shadow-xl { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important; }
.shadow-2xl { box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important; }

.shadow-primary { box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3) !important; }
.shadow-success { box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important; }
.shadow-danger { box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3) !important; }

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

/* Hover Effects */
.hover-scale:hover { transform: scale(1.05); }
.hover-scale-sm:hover { transform: scale(1.02); }
.hover-scale-lg:hover { transform: scale(1.1); }

.hover-lift:hover { transform: translateY(-5px); }
.hover-lift-sm:hover { transform: translateY(-2px); }
.hover-lift-lg:hover { transform: translateY(-8px); }

.hover-rotate:hover { transform: rotate(5deg); }
.hover-rotate-sm:hover { transform: rotate(2deg); }

/* Transition Utilities */
.transition-fast { transition: all 0.15s ease !important; }
.transition-normal { transition: all 0.3s ease !important; }
.transition-slow { transition: all 0.5s ease !important; }

/* Loading Animations */
@keyframes pulse-custom {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce-custom {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-8px,0); }
    70% { transform: translate3d(0,-4px,0); }
    90% { transform: translate3d(0,-2px,0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.animate-pulse-custom { animation: pulse-custom 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce-custom { animation: bounce-custom 1s infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }

/* ========================================
   POSITION UTILITIES
   ======================================== */

.position-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================
   OVERFLOW UTILITIES
   ======================================== */

.overflow-hidden-x { overflow-x: hidden !important; }
.overflow-hidden-y { overflow-y: hidden !important; }
.overflow-scroll-smooth { 
    overflow-y: auto; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Mobile-specific utilities */
@media (max-width: 576px) {
    .mobile-hide { display: none !important; }
    .mobile-show { display: block !important; }
    .mobile-flex { display: flex !important; }
    
    .text-xs-sm { font-size: 0.75rem !important; }
    .text-xs-md { font-size: 0.875rem !important; }
    
    .p-xs-1 { padding: 0.25rem !important; }
    .p-xs-2 { padding: 0.5rem !important; }
    .m-xs-1 { margin: 0.25rem !important; }
    .m-xs-2 { margin: 0.5rem !important; }
}

/* Desktop-specific utilities */
@media (min-width: 768px) {
    .desktop-hide { display: none !important; }
    .desktop-show { display: block !important; }
    .desktop-flex { display: flex !important; }
}

/* ========================================
   ACCESSIBILITY UTILITIES
   ======================================== */

/* Focus states */
.focus-ring-primary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.focus-ring-none:focus {
    outline: none !important;
}

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

/* ========================================
   CUSTOM COMPONENTS
   ======================================== */

/* Music Player Specific */
.player-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.player-thumbnail-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.player-thumbnail-lg {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
}

/* Search Result Components */
.search-result-thumbnail {
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f0f0f0;
}

/* Navigation Buttons */
.nav-btn-custom {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* ========================================
   DARK MODE SUPPORT (Future Enhancement)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .dark-mode-bg {
        background-color: #1a1a1a !important;
    }
    
    .dark-mode-text {
        color: #ffffff !important;
    }
    
    .dark-mode-border {
        border-color: #333333 !important;
    }
}

/* ========================================
   PRINT UTILITIES
   ======================================== */

@media print {
    .print-hide { display: none !important; }
    .print-show { display: block !important; }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .reduced-motion-safe {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    * {
        scroll-behavior: auto !important;
    }
}
