/* 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, #ff4081 0%, #00ff80 50%, #8000ff 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Disable text selection on video elements */
video, .video-item, .video-thumbnail {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Header styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    height: 60px;
    width: auto;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}


/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Video directories */
.video-directories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.directory-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.directory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.directory-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.directory-count {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Video grid */
.video-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.video-item {
    width: 200px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-item:hover {
    /* Removed transform to prevent gradient pane movement */
}

/* Keyboard navigation styles */
.video-selected {
    border: 3px solid #667eea !important;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6) !important;
    transform: scale(1.05) !important;
    z-index: 10;
    position: relative;
}

.video-selected .video-play-overlay {
    opacity: 1 !important;
    background: rgba(102, 126, 234, 0.9) !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

.video-thumbnail {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff4081 0%, #00ff80 50%, #8000ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 8px;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-item:hover .video-play-overlay {
    opacity: 1;
}


/* Video Tooltip Styles */
.video-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    max-width: 300px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-100%) scale(0.9);
    transition: all 0.2s ease;
    z-index: 1000;
}

.video-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-100%) scale(1);
}

.tooltip-content {
    text-align: left;
}

.tooltip-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #fff;
    line-height: 1.3;
}

.tooltip-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Video modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.video-modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ff4081;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    pointer-events: auto;
}

.video-modal-close:hover {
    background: #e91e63;
    transform: scale(1.1);
}

.video-modal video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

.video-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 2rem;
    text-align: center;
    margin-top: 0;
}

footer p {
    color: #666;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.2;
}

.footer {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 0.5rem 2rem !important;
    text-align: center;
    margin-top: 0 !important;
    border-top: 1px solid #e5e5e5;
}

.footer p {
    color: #666 !important;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.2;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    text-align: center;
    margin-bottom: 0;
    color: #666;
    font-size: 0.85rem;
    display: none;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.4rem 0.8rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-pages {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-page {
    padding: 0.4rem 0.6rem;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 35px;
    text-align: center;
    font-size: 0.85rem;
}

.pagination-page:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.pagination-page.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-page.active:hover {
    transform: none;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .pagination-page {
        padding: 0.4rem 0.6rem;
        min-width: 35px;
        font-size: 0.8rem;
    }
}

/* Permanent Modal Styles */
.permanent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: auto;
}

.permanent-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem 3rem;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.permanent-modal-content p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* Disable body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-text {
        flex-direction: column;
        gap: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        height: 50px;
    }
    
    .video-directories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-list {
        gap: 10px;
    }
    
    .video-item {
        width: 150px;
    }
    
    main {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }
    
    .video-item {
        width: 120px;
    }
    
    .video-modal-content {
        padding: 1rem;
        margin: 1rem;
    }
    
    .permanent-modal-content {
        padding: 1.5rem 2rem;
        max-width: 90%;
    }
    
    .permanent-modal-content p {
        font-size: 1.2rem;
    }
}