/**
 * PeniStreamer Plugin Styles
 * Custom Video.js skins and player controls
 */

/* Base Player Styles */
.penistreamer-container {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #000;
}

.penistreamer-player {
    width: 100% !important;
    height: auto !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.penistreamer-description {
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 14px;
    line-height: 1.5;
}

/* Error Message Styles */
.penistreamer-error {
    background: #d32f2f;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* === DEFAULT SKIN === */
.penistreamer-container.default .video-js {
    font-family: inherit;
}

.penistreamer-container.default .video-js .vjs-control-bar {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    height: 4em;
    padding: 0 1em;
}

.penistreamer-container.default .video-js .vjs-button {
    color: #ffffff;
    transition: all 0.3s ease;
}

.penistreamer-container.default .video-js .vjs-button:hover,
.penistreamer-container.default .video-js .vjs-button:focus {
    color: #e53e3e;
    text-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

.penistreamer-container.default .video-js .vjs-play-progress {
    background: #e53e3e;
    box-shadow: 0 0 10px rgba(229, 62, 62, 0.6);
}

.penistreamer-container.default .video-js .vjs-volume-level {
    background: #e53e3e;
}

/* === DARK SKIN === */
.penistreamer-container.dark {
    background: #1a1a1a;
    border: 1px solid #333;
}

.penistreamer-container.dark .video-js {
    background-color: #000;
}

.penistreamer-container.dark .video-js .vjs-control-bar {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
}

.penistreamer-container.dark .video-js .vjs-button {
    color: #ccc;
}

.penistreamer-container.dark .video-js .vjs-button:hover,
.penistreamer-container.dark .video-js .vjs-button:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.penistreamer-container.dark .video-js .vjs-play-progress {
    background: #fff;
}

.penistreamer-container.dark .video-js .vjs-load-progress {
    background: rgba(255, 255, 255, 0.3);
}

.penistreamer-container.dark .penistreamer-description {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

/* === MINIMAL SKIN === */
.penistreamer-container.minimal .video-js .vjs-control-bar {
    background: transparent;
    transition: opacity 0.3s ease;
}

.penistreamer-container.minimal .video-js:not(.vjs-user-active) .vjs-control-bar {
    opacity: 0;
}

.penistreamer-container.minimal .video-js .vjs-button {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    margin: 0 2px;
}

.penistreamer-container.minimal .video-js .vjs-play-control {
    width: 3em;
    height: 3em;
}

.penistreamer-container.minimal .video-js .vjs-progress-control {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.penistreamer-container.minimal .video-js .vjs-progress-holder {
    background: rgba(255, 255, 255, 0.3);
}

.penistreamer-container.minimal .video-js .vjs-play-progress {
    background: #ff4444;
}

/* === NEON SKIN === */
.penistreamer-container.neon {
    background: #0a0a0a;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    border: 1px solid #00ffff;
}

.penistreamer-container.neon .video-js .vjs-control-bar {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%);
    border-top: 1px solid #00ffff;
}

.penistreamer-container.neon .video-js .vjs-button {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.penistreamer-container.neon .video-js .vjs-button:hover,
.penistreamer-container.neon .video-js .vjs-button:focus {
    color: #ffffff;
    text-shadow: 0 0 15px #00ffff, 0 0 25px #00ffff;
}

.penistreamer-container.neon .video-js .vjs-play-progress {
    background: linear-gradient(90deg, #00ffff 0%, #ff00ff 100%);
    box-shadow: 0 0 10px #00ffff;
}

.penistreamer-container.neon .video-js .vjs-volume-level {
    background: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

/* === GLASS SKIN === */
.penistreamer-container.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.penistreamer-container.glass .video-js .vjs-control-bar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.penistreamer-container.glass .video-js .vjs-button {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.penistreamer-container.glass .video-js .vjs-button:hover,
.penistreamer-container.glass .video-js .vjs-button:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.penistreamer-container.glass .video-js .vjs-play-progress {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

/* Live Indicator */
.penistreamer-live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff0000;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Stream List Styles */
.penistreamer-stream-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.penistreamer-stream-list.penistreamer-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.penistreamer-stream-list.penistreamer-list-list {
    grid-template-columns: 1fr;
}

.penistreamer-stream-list.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.penistreamer-stream-list.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.penistreamer-stream-list.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.penistreamer-stream-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.penistreamer-stream-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stream-poster {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.stream-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.stream-poster:hover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stream-poster:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
}

.play-button:hover {
    background: #fff;
    transform: scale(1.1);
}

.stream-content {
    padding: 20px;
}

.stream-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
}

.stream-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.stream-title a:hover {
    color: #e53e3e;
}

.stream-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.stream-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.stream-status.status-active {
    background: #4caf50;
    color: white;
}

.stream-status.status-inactive {
    background: #f44336;
    color: white;
}

.stream-viewers {
    color: #666;
}

/* Live Count Widget */
.penistreamer-live-count {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff0000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.penistreamer-live-count::before {
    content: "●";
    margin-right: 5px;
    animation: pulse 2s infinite;
}

/* No Streams Message */
.penistreamer-no-streams {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .penistreamer-container {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .penistreamer-description {
        padding: 10px;
        font-size: 13px;
    }
    
    .penistreamer-stream-list.columns-2,
    .penistreamer-stream-list.columns-3,
    .penistreamer-stream-list.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .penistreamer-stream-list {
        gap: 15px;
    }
    
    .stream-poster {
        height: 150px;
    }
    
    .stream-content {
        padding: 15px;
    }
    
    .stream-title {
        font-size: 16px;
    }
    
    /* Touch-friendly controls on mobile */
    .penistreamer-container.default .video-js .vjs-control-bar {
        height: 5em;
        padding: 0 0.5em;
    }
    
    .penistreamer-container.default .video-js .vjs-button {
        font-size: 2em;
        width: 2em;
        height: 2em;
    }
}

@media (max-width: 480px) {
    .penistreamer-stream-list {
        gap: 10px;
        margin: 10px 0;
    }
    
    .stream-poster {
        height: 120px;
    }
    
    .stream-content {
        padding: 12px;
    }
    
    .stream-title {
        font-size: 14px;
    }
    
    .stream-description {
        font-size: 13px;
    }
}

/* Loading Animation */
.penistreamer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #000;
    color: #fff;
}

.penistreamer-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Quality Selector */
.vjs-quality-selector {
    position: relative;
}

.vjs-quality-selector .vjs-menu {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 4px;
}

.vjs-quality-selector .vjs-menu-item {
    color: #fff;
    transition: background-color 0.3s ease;
}

.vjs-quality-selector .vjs-menu-item:hover,
.vjs-quality-selector .vjs-menu-item.vjs-selected {
    background-color: #e53e3e;
}

/* Fullscreen Improvements */
.video-js.vjs-fullscreen {
    background: #000;
}

.video-js.vjs-fullscreen .vjs-control-bar {
    font-size: 1.4em;
}

/* Accessibility Improvements */
.video-js .vjs-button:focus {
    outline: 2px solid #e53e3e;
    outline-offset: 2px;
}

.video-js .vjs-slider:focus {
    box-shadow: 0 0 0 2px #e53e3e;
}

/* Custom Context Menu */
.penistreamer-context-menu {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 150px;
    z-index: 1000;
    display: none;
}

.penistreamer-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.penistreamer-context-menu li {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.penistreamer-context-menu li:hover {
    background: #e53e3e;
}

/* Social Sharing Overlay */
.penistreamer-share-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.penistreamer-share-button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.penistreamer-share-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}