/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 30px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    text-align: left;
}

.header-right {
    text-align: right;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tiktok-btn {
    background: linear-gradient(45deg, #ff0050, #ff4081);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    font-size: 0.9rem;
}

.tiktok-btn:hover {
    background: linear-gradient(45deg, #e6004a, #e91e63);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.welcome-text {
    font-size: 1rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Video section */
.video-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#videoPlayer {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: block;
}

.video-info {
    padding: 20px 0;
}

#videoTitle {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.video-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9rem;
}

.video-details span {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 15px;
}

/* Video list section */
.video-list-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.video-list-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.video-list {
    display: grid;
    gap: 15px;
}

.video-item {
    display: flex;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.video-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-item.active {
    background: #667eea;
    color: white;
    border-color: #5a6fd8;
}

.video-thumbnail {
    width: 80px;
    height: 60px;
    background: #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.play-icon {
    font-size: 24px;
    color: #667eea;
    transition: all 0.3s ease;
}

.video-item:hover .play-icon {
    transform: scale(1.2);
    color: #5a6fd8;
}

.video-item.active .play-icon {
    color: white;
}

.video-details {
    flex: 1;
    min-width: 0;
}

.video-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.video-item.active .video-meta {
    color: rgba(255, 255, 255, 0.8);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.video-item.active .progress-bar {
    background: rgba(255, 255, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.video-item.active .progress-fill {
    background: white;
}

.progress-text {
    font-size: 0.8rem;
    color: #666;
}

.video-item.active .progress-text {
    color: rgba(255, 255, 255, 0.8);
}

.no-videos {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-videos p {
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .video-item {
        flex-direction: column;
        text-align: center;
    }

    .video-thumbnail {
        width: 100%;
        height: 120px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .video-details {
        gap: 10px;
    }

    #videoPlayer {
        min-height: 250px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}