* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

header h1::first-letter {
    color: #ff9000;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

.video-card {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 2px #ff9000;
    border: 0.5px solid #ff9000;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px 2px rgba(255, 144, 0, 1)
}

.video-thumbnail {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(3px);
    z-index: 0;
}

.thumbnail-overlay {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.3s ease;
    top: 0;
    left: 0;
}

/* .video-card:hover .thumbnail-overlay {
    background: rgba(255, 144, 0, 0.2);
} */

.play-icon {
    position: relative;
    z-index: 1;
    width: 0;
    height: 0;
    border-left: 40px solid #ff9000;
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
}

.video-details {
    padding: 15px;
}

.video-details {
    padding: 15px;
}

.video-details h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    margin-top: 5px;
}

.video-stats .views {
    color: #b3b3b3;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-stats .rating {
    background: #ff9000;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85em;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    z-index: 2;
}

.video-details p {
    color: #b3b3b3;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #1a1a1a;
    margin: auto;
    padding: 30px;
    width: 90%;
    max-width: 1000px;
    border-radius: 15px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-btn:hover,
.close-btn:focus {
    color: #ff9000;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio - always landscape on desktop */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile video player styles */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 177.78% !important; /* Force 9:16 ratio on mobile */
        max-width: 100%;
    }
    
    .modal-content {
        padding: 10px;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .video-container {
        flex: 1;
        margin: 0;
    }

    .video-info {
        margin-top: 10px;
    }

    /* Ensure video fills container on mobile */
    .video-container video {
        object-fit: contain;
        background: #000;
    }
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
}

/* Video controls styling */
video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
}

video::-webkit-media-controls-play-button,
video::-webkit-media-controls-fullscreen-button {
    filter: brightness(0) saturate(100%) invert(61%) sepia(93%) saturate(1543%) hue-rotate(1deg) brightness(102%) contrast(105%);
}

.video-info {
    color: white;
}

.video-info h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.video-info p {
    color: #ccc;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
        padding: 10px;
    }
    
    .video-thumbnail {
        height: 140px;
    }
    
    .video-details {
        padding: 10px;
    }
    
    .video-details h3 {
        font-size: 0.95em;
    }
    
    .video-stats {
        font-size: 0.8em;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .video-info h2 {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}
