/* Ah Aye Yo! Playlist Player - Modern Styles v2.0 */

/* CSS Variables for easy customization */
:root {
    --ay-primary-gradient: linear-gradient(135deg, #b24592 0%, #f15f79 100%);
    --ay-secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ay-glass-bg: rgba(255, 255, 255, 0.1);
    --ay-glass-border: rgba(255, 255, 255, 0.18);
    --ay-text-primary: #2d3748;
    --ay-text-secondary: #4a5568;
    --ay-text-light: #718096;
    --ay-border-radius: 16px;
    --ay-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Player Container */
.ay-playlist-player {
    max-width: 100%;
    margin: 30px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
}

/* Genre Selector with Glassmorphism */
.ay-genre-selector {
    background: var(--ay-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--ay-glass-border);
    border-radius: var(--ay-border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.ay-genre-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--ay-text-primary);
    letter-spacing: -0.5px;
}

/* Custom Dropdown Wrapper */
.ay-genre-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

/* Fixed Dropdown Styling */
.ay-genre-dropdown {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ay-text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--ay-transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ay-genre-dropdown:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #b24592;
    box-shadow: 0 4px 12px rgba(178, 69, 146, 0.15);
}

.ay-genre-dropdown:focus {
    outline: none;
    border-color: #b24592;
    box-shadow: 0 0 0 3px rgba(178, 69, 146, 0.1);
}

/* Custom Dropdown Arrow */
.ay-dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #b24592;
    transition: var(--ay-transition);
}

.ay-genre-dropdown:hover ~ .ay-dropdown-arrow {
    transform: translateY(-50%) translateX(2px);
}

/* Player Container with Modern Card Design */
.ay-player-container {
    background: var(--ay-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ay-glass-border);
    border-radius: var(--ay-border-radius);
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Current Track Info */
.ay-current-track {
    background: var(--ay-primary-gradient);
    padding: 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ay-track-info {
    flex: 1;
    min-width: 200px;
}

.ay-track-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.ay-track-artist {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.ay-track-counter {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
}

/* Embed Container with Overlay Effects */
.ay-embed-container {
    position: relative;
    background: #000;
    min-height: 200px;
    overflow: hidden;
}

.ay-embed-wrapper {
    position: relative;
    width: 100%;
}

.ay-embed-wrapper iframe {
    width: 100% !important;
    display: block;
}

.ay-embed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 80%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ay-embed-container:hover .ay-embed-overlay {
    opacity: 1;
}

/* Modern Player Controls */
.ay-player-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.5);
}

.ay-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: var(--ay-secondary-gradient);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--ay-transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ay-control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.ay-control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ay-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.ay-control-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 480px) {
    .ay-btn-text {
        display: none;
    }
    
    .ay-control-btn {
        padding: 12px 16px;
    }
}

/* Playlist Container */
.ay-playlist-container {
    padding: 30px;
    background: rgba(255, 255, 255, 0.7);
}

.ay-playlist-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ay-text-primary);
}

.ay-playlist-wrapper {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
.ay-playlist-wrapper::-webkit-scrollbar {
    width: 8px;
}

.ay-playlist-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ay-playlist-wrapper::-webkit-scrollbar-thumb {
    background: var(--ay-primary-gradient);
    border-radius: 4px;
}

.ay-playlist-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b24592;
}

/* Playlist Items */
.ay-playlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ay-playlist li {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: var(--ay-transition);
    display: flex;
    align-items: center;
    gap: 15px;
}

.ay-playlist li:hover {
    background: #f7fafc;
    padding-left: 24px;
}

.ay-playlist li.active {
    background: var(--ay-primary-gradient);
    color: white;
}

.ay-playlist li.active .ay-playlist-item-artist,
.ay-playlist li.active .ay-playlist-item-platform,
.ay-playlist li.active .ay-playlist-item-number {
    color: rgba(255, 255, 255, 0.9);
}

.ay-playlist li:last-child {
    border-bottom: none;
}

.ay-playlist-item-number {
    width: 30px;
    color: var(--ay-text-light);
    font-weight: 500;
    flex-shrink: 0;
}

.ay-playlist-item-info {
    flex: 1;
    min-width: 0;
}

.ay-playlist-item-title {
    font-weight: 500;
    color: var(--ay-text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ay-playlist-item-artist {
    font-size: 14px;
    color: var(--ay-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ay-playlist-item-platform {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ay-text-secondary);
    background: #edf2f7;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ay-playlist li.active .ay-playlist-item-platform {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading State */
.ay-loading {
    text-align: center;
    padding: 60px;
    background: var(--ay-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--ay-glass-border);
    border-radius: var(--ay-border-radius);
}

.ay-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid transparent;
    border-radius: 50%;
    background: var(--ay-primary-gradient);
    background-clip: border-box;
    animation: ay-spin 1s linear infinite;
}

@keyframes ay-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ay-loading p {
    margin: 0;
    color: var(--ay-text-secondary);
    font-weight: 500;
}

/* No Tracks Message */
.ay-no-tracks {
    text-align: center;
    padding: 60px;
    background: var(--ay-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--ay-glass-border);
    border-radius: var(--ay-border-radius);
}

.ay-no-tracks p {
    margin: 0;
    color: var(--ay-text-secondary);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ay-genre-selector {
        padding: 20px;
    }
    
    .ay-genre-title {
        font-size: 20px;
    }
    
    .ay-current-track {
        padding: 20px;
        text-align: center;
        justify-content: center;
    }
    
    .ay-track-title {
        font-size: 18px;
    }
    
    .ay-player-controls {
        padding: 20px;
        gap: 15px;
    }
    
    .ay-playlist-container {
        padding: 20px;
    }
    
    .ay-playlist-wrapper {
        max-height: 300px;
    }
    
    .ay-playlist li {
        padding: 12px 16px;
    }
    
    .ay-playlist-item-platform {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* Platform-specific embed styles */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive-16by9::before {
    display: block;
    content: "";
    padding-top: 56.25%;
}

.embed-responsive-item {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Hover Effects and Animations */
.ay-playlist-player * {
    box-sizing: border-box;
}

.ay-playlist-player a {
    color: inherit;
    text-decoration: none;
}

/* Focus Styles for Accessibility */
.ay-control-btn:focus,
.ay-genre-dropdown:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Platform Colors */
.ay-playlist-item-platform[data-platform="spotify"] {
    background: #1db954;
    color: white;
}

.ay-playlist-item-platform[data-platform="youtube"] {
    background: #ff0000;
    color: white;
}

.ay-playlist-item-platform[data-platform="soundcloud"] {
    background: #ff5500;
    color: white;
}