/* Modern Video Player Styles */
.tindo-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tindo-video-player video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide download button in webkit browsers */
.tindo-video-player video::-webkit-media-controls-download-button {
    display: none !important;
}

/* Hide picture-in-picture button */
.tindo-video-player video::-webkit-media-controls-picture-in-picture-button {
    display: none !important;
}

/* Controls Container */
.tindo-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 16px 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tindo-video-player:hover .tindo-video-controls,
.tindo-video-player.controls-visible .tindo-video-controls {
    opacity: 1;
    pointer-events: all;
}

/* Progress Bar */
.tindo-progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

.tindo-progress-bar {
    height: 100%;
    background: #ff4458;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.tindo-progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ff4458;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tindo-progress-container:hover .tindo-progress-bar::after {
    opacity: 1;
}

/* Buffer Bar */
.tindo-buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    width: 0%;
}

/* Control Buttons */
.tindo-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tindo-controls-left,
.tindo-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tindo-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.tindo-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.tindo-control-btn:active {
    transform: scale(0.95);
}

.tindo-control-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.tindo-play-btn svg {
    width: 24px;
    height: 24px;
}

/* Time Display */
.tindo-time-display {
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
}

/* Volume Control */
.tindo-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tindo-volume-slider {
    width: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: width 0.3s ease;
    overflow: hidden;
}

.tindo-volume-container:hover .tindo-volume-slider {
    width: 60px;
}

.tindo-volume-bar {
    height: 100%;
    background: #ff4458;
    border-radius: 2px;
    width: 100%;
    transition: width 0.1s ease;
}

/* Loading Spinner */
.tindo-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ff4458;
    border-radius: 50%;
    animation: tindo-spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tindo-video-player.loading .tindo-loading {
    opacity: 1;
}

@keyframes tindo-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Play Button Overlay */
.tindo-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.tindo-video-player.playing .tindo-play-overlay {
    opacity: 0;
    pointer-events: none;
}

.tindo-play-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tindo-play-overlay:hover .tindo-play-button {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.tindo-play-button i {
    color: white;
    font-size: 24px;
    margin-left: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Error Message */
.tindo-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    max-width: 80%;
}

.tindo-error h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.tindo-error p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tindo-video-controls {
        padding: 16px 12px 12px;
    }
    
    .tindo-controls-row {
        gap: 8px;
    }
    
    .tindo-control-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .tindo-control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .tindo-play-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .tindo-time-display {
        font-size: 12px;
    }
    
    .tindo-play-overlay {
        width: 60px;
        height: 60px;
    }
    
    .tindo-play-overlay svg {
        width: 24px;
        height: 24px;
    }
    
    .tindo-volume-slider {
        display: none;
    }
}

@media (max-width: 480px) {
    .tindo-progress-container {
        height: 8px;
        margin-bottom: 8px;
    }
    
    .tindo-video-controls {
        padding: 12px 8px 8px;
    }
    
    .tindo-controls-row {
        gap: 4px;
    }
    
    .tindo-control-btn {
        min-width: 32px;
        height: 32px;
        padding: 4px;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .tindo-video-player {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
}

/* Accessibility */
.tindo-control-btn:focus {
    outline: 2px solid #ff4458;
    outline-offset: 2px;
}

.tindo-progress-container:focus {
    outline: 2px solid #ff4458;
    outline-offset: 2px;
}

/* Fullscreen Styles */
.tindo-video-player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
}

.tindo-video-player.fullscreen video {
    object-fit: contain;
}

/* Picture-in-Picture indicator */
.tindo-pip-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tindo-video-player.pip .tindo-pip-indicator {
    opacity: 1;
}