/* Video Library Container */
.pencilart-video-library {
    max-width: 100%;
    margin: 0 auto;
}

/* Library Controls */
.pencilart-library-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.pencilart-search-box {
    flex: 1;
    min-width: 250px;
}

.pencilart-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.pencilart-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.pencilart-filters {
    display: flex;
    gap: 10px;
}

.pencilart-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

/* Video Grid */
.pencilart-video-grid {
    display: grid;
    gap: 20px;
}

.pencilart-columns-1 {
    grid-template-columns: 1fr;
}

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

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

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

.pencilart-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.pencilart-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Video Card */
.pencilart-video-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pencilart-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.pencilart-video-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #f0f0f0;
}

.pencilart-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pencilart-video-card:hover .pencilart-video-thumbnail img {
    transform: scale(1.05);
}

/* Play button overlay */
.pencilart-video-thumbnail::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: background-color 0.3s ease;
    pointer-events: none;
}

.pencilart-video-card:hover .pencilart-video-thumbnail::after {
    background: rgba(0, 0, 0, 0.9);
}

.pencilart-video-thumbnail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
    transform: translate(-40%, -50%);
    z-index: 1;
    pointer-events: none;
}

.pencilart-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.pencilart-video-placeholder .dashicons {
    font-size: 48px;
    color: #999;
}

.pencilart-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.pencilart-watched-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4CAF50;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pencilart-watched-badge .dashicons {
    font-size: 20px;
}

/* Badge con percentuale numerica */
.pencilart-percentage-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 123, 186, 0.95);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Colori diversi in base alla percentuale */
.pencilart-video-card:has(.pencilart-percentage-badge) .pencilart-percentage-badge {
    background: rgba(255, 152, 0, 0.95); /* Arancione per video in progress */
}

/* Hover effect sul badge percentuale */
.pencilart-percentage-badge:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Barra di progresso migliorata */
.pencilart-progress-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px; /* Aumentata da 4px a 8px */
    background: rgba(0, 0, 0, 0.5); /* Sfondo più scuro per contrasto */
    z-index: 9;
}

.pencilart-progress-bar-mini {
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.pencilart-progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #00a0d2 100%); /* Gradiente per maggiore visibilità */
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 123, 186, 0.5); /* Glow effect */
    position: relative;
}

/* Effetto pulsante sulla barra */
.pencilart-progress-fill-mini::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Indicatore Continua a guardare */
.pencilart-continue-watching {
    margin-top: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 2px 12px rgba(102, 126, 234, 0.6);
    }
}

.pencilart-continue-icon {
    font-size: 16px;
    display: inline-block;
}

/* Messaggio di ripresa nel player */
.pencilart-resume-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.pencilart-resume-icon {
    color: #4caf50;
    font-size: 18px;
}

.pencilart-resume-text {
    flex: 1;
}

.pencilart-restart-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    line-height: 1;
}

.pencilart-restart-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(360deg);
}

/* Video Inline Mode */
.pencilart-video-card.pencilart-loading-inline {
    position: relative;
    min-height: 400px;
}

.pencilart-inline-loading {
    padding: 50px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.pencilart-video-card.pencilart-video-inline-active {
    grid-column: 1 / -1; /* Espande su tutte le colonne */
    animation: expandInline 0.3s ease;
}

@keyframes expandInline {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pencilart-inline-video-wrapper {
    position: relative;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.pencilart-inline-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pencilart-inline-close:hover {
    background: #e74c3c;
    transform: scale(1.05);
}

.pencilart-inline-close::before {
    content: '✕';
    font-size: 16px;
    font-weight: bold;
}

/* Player inline specifici */
.pencilart-inline-video-wrapper .pencilart-video-player {
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 8px;
}

.pencilart-inline-video-wrapper .pencilart-video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* Mantieni i controlli nativi per inline mode */
.pencilart-inline-video-wrapper .pencilart-video-player {
    display: block;
}

/* Responsive per inline video */
@media (max-width: 768px) {
    .pencilart-video-card.pencilart-video-inline-active {
        grid-column: 1;
    }
    
    .pencilart-inline-video-wrapper {
        padding: 10px;
    }
    
    .pencilart-inline-close {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .pencilart-inline-video-wrapper .pencilart-video-player {
        max-height: 50vh;
    }
}

/* Video Info */
.pencilart-video-info {
    padding: 15px;
}

.pencilart-video-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.pencilart-video-title a {
    color: #333;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pencilart-video-title a:hover {
    color: #007cba;
}

.pencilart-video-excerpt {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pencilart-video-meta {
    font-size: 13px;
    color: #999;
}

/* Video Modal */
.pencilart-video-modal {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    /* Ensure modal is clickable */
    pointer-events: auto;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.pencilart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: fit-content;
    max-width: 95vw;
    max-height: 95vh;
    background: transparent;
    border-radius: 16px;
    overflow: visible;
    z-index: 100000;
    padding: 0;
}

.pencilart-modal-close {
    position: absolute;
    top: -60px;
    right: 0;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pencilart-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Removed ::before pseudo-element to fix double XX issue */

/* Hide any second X that might appear */
.pencilart-modal-content > span.pencilart-modal-close:nth-of-type(2) {
    display: none !important;
}

/* Ensure only one X is visible */
.pencilart-modal-content > .pencilart-modal-close {
    display: flex !important;
}

/* Hide any X inside video elements */
.pencilart-video-player-wrapper .pencilart-modal-close,
.pencilart-video-overlay .pencilart-modal-close {
    display: none !important;
}

/* Remove any duplicate close buttons */
.pencilart-modal-content .pencilart-modal-close ~ .pencilart-modal-close {
    display: none !important;
}

/* Hide close button that might be in video container */
.pencilart-video-container .pencilart-modal-close {
    display: none !important;
}

.pencilart-modal-body {
    position: relative;
    width: fit-content;
    height: fit-content;
    z-index: 1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Video Player Wrapper */
.pencilart-video-player-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Override for modal video */
.pencilart-modal-body .pencilart-video-player-wrapper {
    width: auto;
    height: auto;
}

/* Modern Player Styles */
.pencilart-modern-player {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.pencilart-modern-player .pencilart-video-container {
    position: relative;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

/* Simple Quality Selector */
.pencilart-simple-quality-selector {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    pointer-events: auto;
}

.pencilart-simple-quality-selector select {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.pencilart-simple-quality-selector select:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.9);
}

/* Style native video controls */
.pencilart-video-player {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.pencilart-video-player::-webkit-media-controls {
    position: relative;
    z-index: 10;
    display: flex !important;
    opacity: 1 !important;
    border-radius: 0 0 8px 8px;
}

.pencilart-video-player::-webkit-media-controls-panel {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}

/* Ensure video controls are visible with modern style */
.pencilart-video-player::-webkit-media-controls-enclosure {
    display: flex !important;
    background: transparent;
}

.pencilart-video-player::-webkit-media-controls-panel {
    display: flex !important;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
}

/* Hide native controls in modal */
.pencilart-modal-body .pencilart-video-player::-webkit-media-controls {
    display: none !important;
}

.pencilart-modal-body .pencilart-video-player::-moz-media-controls {
    display: none !important;
}


/* Disabilita il menu contestuale */
.pencilart-video-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Fullscreen video fixes */
.pencilart-video-container:fullscreen,
.pencilart-video-container:-webkit-full-screen,
.pencilart-video-container:-moz-full-screen,
.pencilart-video-container:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pencilart-video-container:fullscreen .pencilart-video-player,
.pencilart-video-container:-webkit-full-screen .pencilart-video-player,
.pencilart-video-container:-moz-full-screen .pencilart-video-player,
.pencilart-video-container:-ms-fullscreen .pencilart-video-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Fix fullscreen controls position */
.pencilart-video-container:fullscreen .pencilart-controls-bar,
.pencilart-video-container:-webkit-full-screen .pencilart-controls-bar,
.pencilart-video-container:-moz-full-screen .pencilart-controls-bar,
.pencilart-video-container:-ms-fullscreen .pencilart-controls-bar {
    width: 100%;
    left: 0;
    right: 0;
}

/* Pulsante unmute */
.pencilart-unmute-btn {
    transition: opacity 0.3s ease;
}

.pencilart-unmute-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.05);
}

/* Modern Controls - Temporaneamente disabilitati */
/*
.pencilart-modern-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pencilart-video-container:hover .pencilart-modern-controls,
.pencilart-video-container.controls-visible .pencilart-modern-controls {
    opacity: 1;
}
*/

/* Custom controls are now active for modal player */

/* Responsive Design */
@media (max-width: 768px) {
    .pencilart-simple-quality-selector select {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .pencilart-video-container {
        border-radius: 4px;
    }
    
    /* Adjust close button position on mobile */
    .pencilart-modal-close {
        top: -50px;
    }
}

/* Modal Styling Updates */
.pencilart-video-modal .pencilart-modal-content {
    background: transparent;
    border: none;
}

/* Video container and player */
.pencilart-modal-body .pencilart-video-player-wrapper {
    position: relative;
}

.pencilart-modal-body .pencilart-video-container {
    position: relative;
}

/* Video in modal */
.pencilart-modal-body .pencilart-video-player {
    display: block;
    max-height: 88vh;
    max-width: 92vw;
    height: 88vh;
    width: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    background: #000;
}

/* Force video controls to show */
.pencilart-video-player[controls] {
    /* Ensure controls attribute works */
}


/* Ensure video container doesn't block interactions */
.pencilart-video-container * {
    pointer-events: auto;
}

/* Custom Video Controls Overlay */
.pencilart-modal-body .pencilart-video-container {
    position: relative;
    cursor: pointer;
}

.pencilart-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Central Play/Pause Button */
.pencilart-play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    opacity: 0;
}

.pencilart-video-container:hover .pencilart-play-pause-btn {
    opacity: 1;
}

.pencilart-video-container.paused .pencilart-play-pause-btn {
    opacity: 1;
}

.pencilart-play-pause-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.pencilart-play-pause-btn svg {
    width: 50px;
    height: 50px;
}

/* Bottom Controls Bar */
.pencilart-controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    padding: 20px 20px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.pencilart-video-container:hover .pencilart-controls-bar {
    opacity: 1;
}

.pencilart-video-container.controls-visible .pencilart-controls-bar {
    opacity: 1;
}

/* Progress Bar */
.pencilart-progress-bar-custom {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 15px;
}

.pencilart-progress-bar-custom:hover {
    height: 8px;
}

.pencilart-progress-buffered {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.pencilart-progress-played {
    position: absolute;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    width: 0%;
}

.pencilart-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s;
}

.pencilart-progress-bar-custom:hover .pencilart-progress-handle {
    opacity: 1;
}

/* Bottom Controls Layout */
.pencilart-controls-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pencilart-play-pause-small,
.pencilart-volume-btn,
.pencilart-fullscreen-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.pencilart-play-pause-small:hover,
.pencilart-volume-btn:hover,
.pencilart-fullscreen-btn:hover {
    transform: scale(1.1);
}

/* Volume control container */
.pencilart-volume-control {
    display: flex;
    align-items: center;
    position: relative;
}

/* Volume slider */
.pencilart-volume-slider-container {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    width: 120px;
    z-index: 100;
}

.pencilart-volume-control:hover .pencilart-volume-slider-container {
    opacity: 1;
    visibility: visible;
}

.pencilart-volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
    border-radius: 2px;
}

.pencilart-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.pencilart-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: transform 0.2s;
}

.pencilart-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.pencilart-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.pencilart-time-display {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pencilart-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Remove old title styles */
.pencilart-video-player-wrapper .pencilart-video-title {
    display: none;
    margin: 0;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
}

.pencilart-video-iframe-container {
    position: relative;
    flex: 1;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.pencilart-video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pencilart-video-description {
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    max-height: 150px;
    overflow-y: auto;
}

/* Loading State */
.pencilart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #fff;
    font-size: 18px;
}

.pencilart-loading-spinner {
    text-align: center;
    padding: 40px;
}

/* Error Messages */
.pencilart-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.pencilart-no-videos {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Login Required */
.pencilart-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f0f0f0;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .pencilart-columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    .pencilart-columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pencilart-columns-6,
    .pencilart-columns-5,
    .pencilart-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pencilart-library-controls {
        flex-direction: column;
    }
    
    .pencilart-search-box {
        width: 100%;
    }
    
    .pencilart-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .pencilart-modal-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .pencilart-columns-6,
    .pencilart-columns-5,
    .pencilart-columns-4,
    .pencilart-columns-3,
    .pencilart-columns-2 {
        grid-template-columns: 1fr;
    }
}

/* All Libraries View */
.pencilart-all-libraries {
    margin-top: 20px;
}

.pencilart-library-section {
    margin-bottom: 60px;
}

.pencilart-library-section .pencilart-library-title {
    font-size: 28px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}