/* Vectra.music - Custom Styles */

/* CSS Variables */
:root {
    --accent-color: #22d3ee;
    --gradient-start: #22d3ee;
    --gradient-end: #a855f7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-color), 0 0 40px var(--accent-color);
    }

    50% {
        box-shadow: 0 0 30px var(--accent-color), 0 0 60px var(--accent-color);
    }
}

@keyframes eqBar {
    from {
        height: 20%;
    }

    to {
        height: 100%;
    }
}

@keyframes shimmer {
    from {
        background-position: -200% 0;
    }

    to {
        background-position: 200% 0;
    }
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #12121a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #06b6d4, #9333ea);
}

/* Channel Card Styles */
.channel-card {
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.channel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            transparent 0%,
            rgba(255, 255, 255, 0.03) 50%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.channel-card:hover::before {
    opacity: 1;
}

.channel-card:hover {
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateY(-4px);
}

.channel-card.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}

/* Glassmorphism Effects */
.glass {
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Neon Glow Effect */
.neon-glow {
    box-shadow:
        0 0 10px var(--accent-color),
        0 0 20px var(--accent-color),
        0 0 30px var(--accent-color);
}

/* Volume Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #22222e;
    border-radius: 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    border-radius: 50%;
    margin-top: -5px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: #22222e;
    border-radius: 10px;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #22d3ee, #a855f7);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Play Button Animation */
#playPauseBtn {
    position: relative;
    overflow: hidden;
}

#playPauseBtn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #22d3ee, #a855f7, #f43f5e, #22d3ee);
    background-size: 300% 300%;
    border-radius: 50%;
    z-index: -1;
    animation: gradient-rotate 3s linear infinite;
}

@keyframes gradient-rotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#playPauseBtn:active {
    transform: scale(0.95);
}

/* Equalizer Bars Animation */
.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
}

.eq-bar {
    width: 3px;
    background: linear-gradient(to top, #22d3ee, #a855f7);
    border-radius: 1px;
    animation: eqBar 0.5s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) {
    animation-delay: 0s;
}

.eq-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.eq-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.eq-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.eq-bar:nth-child(5) {
    animation-delay: 0.4s;
}

/* Progress Bar */
#progressWrapper:hover #progressBar {
    background: linear-gradient(90deg, #22d3ee, #a855f7, #f43f5e);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .channel-card {
        padding: 12px;
    }

    .channel-card h3 {
        font-size: 12px;
    }

    .channel-card p {
        display: none;
    }

    #playerControls>div {
        padding: 16px;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg,
            #1a1a24 0%,
            #22222e 50%,
            #1a1a24 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Notification Toast */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

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

/* Hero Banner Parallax Effect */
#heroBanner {
    transform: translateZ(0);
    will-change: transform;
}

/* Channel Grid - Horizontal Scroll on Mobile */
@media (max-width: 640px) {
    #channelGrid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        gap: 12px;
    }

    #channelGrid .channel-card {
        flex: 0 0 140px;
        scroll-snap-align: start;
    }

    #channelGrid::-webkit-scrollbar {
        display: none;
    }
}

/* Modal Backdrop */
#sleepTimerModal {
    animation: fadeIn 0.2s ease-out;
}

#sleepTimerModal>div {
    animation: fadeIn 0.3s ease-out;
}

/* Like/Dislike Button Animation */
#likeBtn.text-green-400,
#dislikeBtn.text-red-400 {
    animation: pulseOnce 0.3s ease-out;
}

@keyframes pulseOnce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Ad Overlay */
#adOverlay {
    animation: fadeIn 0.3s ease-out;
}

/* Keyboard Shortcuts Info */
#shortcutsInfo kbd {
    font-family: 'Inter', monospace;
    font-size: 10px;
}

/* Hover Effects */
button:not(:disabled):hover {
    transition: all 0.2s ease;
}

/* Focus States */
button:focus,
input:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Disable Selection on Controls */
#playerSection button,
.genre-card {
    -webkit-user-select: none;
    user-select: none;
}

/* Slide-out Menu */
#genreMenu.open {
    transform: translateX(0);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

/* Genre Card in Menu */
.genre-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(26, 26, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.genre-card:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateX(-4px);
}

.genre-card.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
    border-color: var(--accent-color);
}

.genre-card .emoji {
    font-size: 24px;
}

.genre-card .name {
    font-weight: 600;
    font-size: 14px;
}

.genre-card .desc {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Play Icon for Channels */
.genre-card .channel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
    border-radius: 50%;
    transition: all 0.3s ease;
}

.genre-card .channel-icon .play-icon {
    width: 18px;
    height: 18px;
    color: #22d3ee;
    transition: all 0.3s ease;
}

.genre-card:hover .channel-icon {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.4), rgba(168, 85, 247, 0.4));
    transform: scale(1.1);
}

.genre-card:hover .channel-icon .play-icon {
    color: #fff;
}

.genre-card.active .channel-icon {
    background: linear-gradient(135deg, #22d3ee, #a855f7);
}

.genre-card.active .channel-icon .play-icon {
    color: #fff;
}

/* Playlist Item */
.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.1), transparent);
    border-left: 3px solid #22d3ee;
}

.playlist-item .index {
    width: 24px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

.playlist-item.active .index {
    color: #22d3ee;
}

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

.playlist-item .track-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .track-artist {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .playing-indicator {
    display: none;
}

.playlist-item.active .playing-indicator {
    display: flex;
}

/* Playing indicator animation */
.playing-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.playing-bars span {
    width: 3px;
    background: linear-gradient(to top, #22d3ee, #a855f7);
    border-radius: 1px;
    animation: eqBar 0.4s ease-in-out infinite alternate;
}

.playing-bars span:nth-child(1) {
    animation-delay: 0s;
    height: 8px;
}

.playing-bars span:nth-child(2) {
    animation-delay: 0.1s;
    height: 12px;
}

.playing-bars span:nth-child(3) {
    animation-delay: 0.2s;
    height: 6px;
}

/* Favorites Card Special Styling */
.genre-card.favorites-card {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(168, 85, 247, 0.1));
    border-color: rgba(244, 63, 94, 0.3);
}

.genre-card.favorites-card:hover {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(168, 85, 247, 0.15));
    border-color: rgba(244, 63, 94, 0.5);
}

/* Drag Handle */
.drag-handle {
    width: 24px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    cursor: grab;
    letter-spacing: -2px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Remove Favorite Button */
.remove-fav-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.playlist-item:hover .remove-fav-btn {
    opacity: 1;
}

.remove-fav-btn:hover {
    color: #f43f5e;
}

/* Drag States */
.playlist-item.dragging {
    opacity: 0.5;
    background: rgba(168, 85, 247, 0.1);
}

.playlist-item.drag-over {
    border-top: 2px solid #a855f7;
    background: rgba(168, 85, 247, 0.05);
}

/* Heart Button Active State */
#favoriteBtn.text-red-500 svg {
    fill: #f43f5e;
}