/* audio-player.css - مشغل موسيقى متطور لـ Song For You */

/* المشغل العائم */
.floating-audio-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5),
                0 5px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    overflow: hidden;
    transform: translateY(150%);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-audio-player.show {
    transform: translateY(0);
}

/* رأس المشغل */
.player-header {
    padding: 20px;
    background: linear-gradient(to right, rgba(37, 117, 252, 0.1), rgba(106, 17, 203, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-header h3 i {
    color: var(--primary-color);
}

.close-player {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-player:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* جسم المشغل */
.player-body {
    padding: 25px;
}

/* معلومات الأغنية */
.song-info-large {
    text-align: center;
    margin-bottom: 25px;
}

.song-cover {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3),
                inset 0 0 0 3px rgba(37, 117, 252, 0.3);
    animation: rotateAlbum 20s linear infinite;
    animation-play-state: paused;
}

.song-cover.playing {
    animation-play-state: running;
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, 
                rgba(37, 117, 252, 0.2), 
                rgba(106, 17, 203, 0.2));
}

@keyframes rotateAlbum {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.song-title-large {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist-large {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* شريط التقدم */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 0.3s ease;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(37, 117, 252, 0.8);
}

.time-display {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-family: monospace;
}

/* أزرار التحكم */
.player-controls-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.control-btn-large {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.control-btn-large:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn-large:active {
    transform: scale(0.95);
}

.control-btn-large i {
    font-size: 1.2rem;
}

.play-btn-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 5px 20px rgba(37, 117, 252, 0.4);
}

.play-btn-large:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 8px 25px rgba(37, 117, 252, 0.6);
}

.play-btn-large i {
    font-size: 1.5rem;
}

/* شريط الصوت */
.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.volume-control i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    min-width: 24px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(37, 117, 252, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(37, 117, 252, 0.8);
}

/* قائمة التشغيل */
.playlist-container {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.playlist-container h4 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.playlist-item.active {
    background: linear-gradient(to right, 
                rgba(37, 117, 252, 0.2), 
                rgba(106, 17, 203, 0.2));
    border-right: 3px solid var(--primary-color);
}

.playlist-item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.playlist-item-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.playlist-item-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-family: monospace;
}

/* مؤشر التشغيل */
.play-indicator {
    color: var(--primary-color);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-item.active .play-indicator {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* شريط الأدوات السفلي */
.player-toolbar {
    display: flex;
    justify-content: space-between;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toolbar-btn.active {
    background: rgba(37, 117, 252, 0.2);
    color: var(--primary-color);
}

/* مؤشرات الموجات الصوتية */
.waveform {
    height: 40px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.wave-bar {
    width: 3px;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
    animation-play-state: paused;
}

.playing .wave-bar {
    animation-play-state: running;
}

.wave-bar:nth-child(2n) {
    height: 60%;
    animation-delay: 0.2s;
}

.wave-bar:nth-child(3n) {
    height: 80%;
    animation-delay: 0.4s;
}

.wave-bar:nth-child(5n) {
    height: 40%;
    animation-delay: 0.6s;
}

@keyframes wave {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

/* تأثيرات النيون */
.neon-effect {
    position: relative;
}

.neon-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
                var(--primary-color), 
                var(--secondary-color), 
                var(--primary-color));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.neon-effect:hover::before {
    opacity: 0.5;
    filter: blur(5px);
}

/* أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    color: white;
}

.action-btn.like.active {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.action-btn.share:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

/* حجم المشغل المصغر */
.floating-audio-player.minimized {
    width: 300px;
    height: 80px;
}

.floating-audio-player.minimized .player-body,
.floating-audio-player.minimized .playlist-container,
.floating-audio-player.minimized .volume-control,
.floating-audio-player.minimized .player-toolbar {
    display: none;
}

.floating-audio-player.minimized .player-header {
    padding: 15px;
}

.floating-audio-player.minimized .player-header h3 {
    font-size: 1rem;
}

/* تجاوبية */
@media (max-width: 768px) {
    .floating-audio-player {
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: 100%;
    }
    
    .player-controls-large {
        gap: 15px;
    }
    
    .control-btn-large {
        width: 45px;
        height: 45px;
    }
    
    .play-btn-large {
        width: 55px;
        height: 55px;
    }
    
    .song-cover {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .floating-audio-player {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .player-body {
        padding: 20px;
    }
    
    .player-controls-large {
        gap: 10px;
    }
    
    .control-btn-large {
        width: 40px;
        height: 40px;
    }
    
    .play-btn-large {
        width: 50px;
        height: 50px;
    }
    
    .song-cover {
        width: 80px;
        height: 80px;
    }
    
    .song-title-large {
        font-size: 1.2rem;
    }
}

/* فتح وإغلاق متحرك */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.floating-audio-player.slide-in {
    animation: slideInUp 0.5s ease forwards;
}

.floating-audio-player.slide-out {
    animation: slideOutDown 0.5s ease forwards;
}

/* تأثيرات الضوء */
.light-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, 
                transparent, 
                rgba(255, 255, 255, 0.3), 
                transparent);
    animation: lightMove 3s linear infinite;
}

@keyframes lightMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* مؤشر البطارية (إذا كان متصلاً بالجوال) */
.battery-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.battery-level {
    width: 40px;
    height: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.battery-fill {
    height: 100%;
    background: linear-gradient(to right, #27ae60, #2ecc71);
    width: 75%; /* نسبة الشحن */
    transition: width 0.5s ease;
}

.battery-tip {
    width: 3px;
    height: 7px;
    background: rgba(255, 255, 255, 0.3);
    margin-right: -1px;
}

/* حالة البطارية المنخفضة */
.battery-level.low .battery-fill {
    background: linear-gradient(to right, #e74c3c, #c0392b);
}

/* إظهار/إخفاء المشغل */
.player-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(37, 117, 252, 0.4);
    transition: all 0.3s ease;
}

.player-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 117, 252, 0.6);
}

.player-toggle-btn i {
    font-size: 1.5rem;
}

/* تعديل لأجهزة اللمس */
@media (hover: none) and (pointer: coarse) {
    .control-btn-large,
    .action-btn,
    .toolbar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-fill::after {
        width: 20px;
        height: 20px;
        right: -10px;
    }
}

/* تحسينات للأداء */
.floating-audio-player {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* تأثيرات خاصة للعطلات */
.holiday-theme .player-header {
    background: linear-gradient(to right, rgba(231, 76, 60, 0.1), rgba(241, 196, 15, 0.1));
}

.holiday-theme .progress-fill {
    background: linear-gradient(to right, #e74c3c, #f1c40f);
}

.holiday-theme .play-btn-large {
    background: linear-gradient(135deg, #e74c3c, #f1c40f);
}