/* Custom Video Player Styles - LOKALNI VIDEO */
.custom-video-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #000;
    position: relative;
}

.custom-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.custom-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    outline: none;
}

/* HIDDEN YOUTUBE CONTAINER - NEVIDLJIV */
.hidden-youtube-container {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0.01 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: -9999 !important;
    top: -100px !important;
    left: -100px !important;
}

/* Video unavailable state */
.video-unavailable {
    background: #f8f9fa !important;
    padding: 40px !important;
    text-align: center;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-unavailable p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.speed-announcement,
.fullscreen-announcement {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Custom Controls */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(100%);
    z-index: 10;
}

.custom-video-wrapper:hover .custom-controls,
.custom-controls:focus-within {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Bar - REFAKTORISAN - BEZ TEKSTA ISPOD */
.progress-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
}

.progress-bar {
    position: absolute;
    height: 4px;
    background: #2196F3;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
}

.progress-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 20;
    margin: 0;
}

.progress-slider:focus {
    opacity: 1;
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

/* Poboljšaj hover efekat */
.progress-container:hover .progress-bar {
    height: 6px;
}

.progress-container:hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 16px;
    transform: translateY(-50%);
    background: transparent;
    z-index: 10;
}

/* Buttons */
.control-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255,255,255,0.1);
}

.control-btn:focus {
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

.control-btn svg {
    width: 16px;
    height: 16px;
}

.pause-icon {
    display: none;
}

.playing .play-icon {
    display: none;
}

.playing .pause-icon {
    display: block;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.volume-control:hover .volume-slider-container,
.volume-slider:focus ~ .volume-slider-container,
.volume-slider-container:focus-within {
    opacity: 1;
}

.volume-slider {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4444;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4444;
    cursor: pointer;
    border: none;
}

/* Volume icons */
.volume-low,
.volume-mute {
    display: none;
}

.volume-muted .volume-high,
.volume-muted .volume-low {
    display: none;
}

.volume-muted .volume-mute {
    display: block;
}

.volume-low-volume .volume-high {
    display: none;
}

.volume-low-volume .volume-low {
    display: block;
}

/* More Options Menu */
.more-options {
    position: relative;
    display: inline-block;
}

.more-options-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 28, 28, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.more-options-menu.show {
    display: flex;
}

.more-options-menu button {
    background: none;
    border: none;
    color: white;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.1s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.more-options-menu button:hover,
.more-options-menu button:focus {
    background: rgba(255,255,255,0.1);
    outline: none;
}

.submenu-trigger {
    position: relative;
}

.submenu-arrow {
    width: 8px;
    height: 8px;
    transition: transform 0.2s ease;
}

.submenu-trigger[aria-expanded="true"] .submenu-arrow {
    transform: rotate(90deg);
}

/* Speed Submenu */
.speed-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 140px;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.speed-submenu.show {
    display: flex;
}

.speed-submenu button {
    background: none;
    border: none;
    color: white;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    justify-content: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.speed-submenu button[aria-checked="true"] {
    background: rgba(255,68,68,0.2);
    color: #ff4444;
}

.speed-submenu button:hover,
.speed-submenu button:focus {
    background: rgba(255,255,255,0.1);
    outline: none;
}

/* Fullscreen */
:fullscreen .custom-video-wrapper {
    padding-bottom: 0;
    height: 100vh;
}

:-webkit-full-screen .custom-video-wrapper {
    padding-bottom: 0;
    height: 100vh;
}

:-moz-full-screen .custom-video-wrapper {
    padding-bottom: 0;
    height: 100vh;
}

:fullscreen .fullscreen-enter {
    display: none;
}

:fullscreen .fullscreen-exit {
    display: block !important;
}

/* Firefox focus fixes */
.custom-video-container:focus-within {
    outline: none;
}

.custom-video-player:focus-visible {
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

/* Ensure video container can receive focus */
.custom-video-container {
    outline: none;
}

/* Better focus management for Firefox */
.control-btn:-moz-focusring {
    outline: 2px solid #ff4444;
    outline-offset: 2px;
}

/* Remove default Firefox focus styles */
.control-btn::-moz-focus-inner {
    border: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .custom-controls {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .control-btn {
        padding: 4px;
        min-width: 28px;
        height: 28px;
    }
    
    .volume-slider {
        width: 40px;
    }
    
    .more-options-menu {
        min-width: 180px;
        left: auto;
        right: 0;
        transform: none;
    }
    
    .speed-submenu {
        left: auto;
        right: 100%;
    }
}