:root {
    --tk-pink: #fe2c55;
    --tk-cyan: #25f4ee;
    --bg-dark: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    /* Prevent full page scroll, only scroll playlist */
    display: flex;
    flex-direction: column;
    margin: 0;
}

.navbar {
    background-color: rgba(18, 18, 18, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    height: 60px;
}

.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding-top: 60px;
    /* Offset for fixed navbar */
}

/* Player Section */
.player-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
}

.video-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

.btn-control {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.15);
}

.btn-control.active {
    color: #000;
    background: var(--tk-cyan);
    box-shadow: 0 0 10px rgba(37, 244, 238, 0.5);
}

.video-info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to video */
}

.video-info h4 {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.1rem;
}

/* Playlist Section */
.playlist-section {
    width: 380px;
    background: var(--bg-dark);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.playlist-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.playlist-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
    position: relative;
}

.playlist-items::-webkit-scrollbar {
    width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.playlist-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

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

.playlist-item.playing {
    background: rgba(37, 244, 238, 0.08);
    border-color: rgba(37, 244, 238, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pl-thumb-container {
    position: relative;
    width: 65px;
    height: 85px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

.pl-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playing-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--tk-cyan);
    font-size: 1.2rem;
}

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

.pl-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pl-title {
    font-size: 0.9rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #fff;
}

.playlist-item.playing .pl-title {
    color: var(--tk-cyan);
}

.pl-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .playlist-section {
        width: 320px;
    }
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
    }

    .main-container {
        flex-direction: column;
        overflow: hidden;
        padding-top: 60px;
    }

    .player-section {
        height: 50vh;
        flex: none;
    }

    .playlist-section {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        flex: 1;
        min-height: 0;
    }

    .btn-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .video-info h4 {
        font-size: 1rem;
    }
    
    .vertical-controls {
        right: 10px !important;
        gap: 10px !important;
    }
    
    .btn-vertical {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }
    
    .play-overlay-btn {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
    }

    .btn-fullscreen-bottom {
        bottom: 10px !important;
        right: 10px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }
}

/* Auto-Reload Styles */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--tk-cyan);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(37, 244, 238, 0.7);
    animation: pulse-animation 1.5s infinite;
    vertical-align: middle;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 244, 238, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(37, 244, 238, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 244, 238, 0);
    }
}

#reload-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 12, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#reload-overlay.show {
    display: flex !important;
    opacity: 1;
}

/* CSS Additions for Playlist Upgrade */
.playlist-header label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.vertical-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.btn-vertical {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-vertical:hover {
    background: var(--tk-pink);
    border-color: var(--tk-pink);
    transform: scale(1.15);
}

.play-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.play-overlay-btn.playing {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
    pointer-events: none;
}

.play-overlay-btn i {
    margin-left: 4px;
}

.play-overlay-btn.paused-icon i {
    margin-left: 0;
}

.player-actions-dropdown {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.player-actions-dropdown .btn-control {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-actions-dropdown .btn-control:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--tk-cyan);
    border-color: var(--tk-cyan);
}

.player-actions-dropdown .dropdown-menu {
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 0;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.player-actions-dropdown .dropdown-item {
    font-size: 0.85rem;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
}

.player-actions-dropdown .dropdown-item:hover,
.player-actions-dropdown .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--tk-cyan) !important;
}

.player-actions-dropdown .dropdown-item.active i {
    color: var(--tk-cyan);
}

.player-actions-dropdown .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.15);
    color: #ff4d4d !important;
}

.dropdown-toggle-no-caret::after {
    display: none !important;
}

/* Adjustments for links in playlist items */
.pl-thumb-link {
    display: block;
    flex-shrink: 0;
    position: relative;
}

.pl-author-link {
    font-size: 0.8rem;
    color: var(--text-muted) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.pl-author-link:hover {
    color: var(--tk-pink) !important;
}

/* Bottom Fullscreen Button styling */
.btn-fullscreen-bottom {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-fullscreen-bottom:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--tk-cyan);
    border-color: var(--tk-cyan);
    transform: scale(1.1);
}
