/* Videos Section */
.videos-section {
    padding: 120px 5% 60px;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(0, 4, 40, 0.9), rgba(0, 78, 146, 0.9));
}

/* Loading State */
.loading-state {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 1000;
    display: none;
}

.loading-state.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(125, 211, 252, 0.3);
    border-radius: 50%;
    border-top-color: #7dd3fc;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #fff;
}

.section-header h1 {
    font-size: 2.5em;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-header p {
    color: #e2e8f0;
    font-size: 1.1em;
}

/* Video Controls */
.video-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7dd3fc;
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.3);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(125, 211, 252, 0.3);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #7dd3fc;
    color: #000428;
    border-color: #7dd3fc;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.video-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

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

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

.video-info {
    padding: 1.5rem;
}

.video-info h3 {
    font-size: 1.2em;
    margin: 0 0 0.8rem;
    color: #fff;
}

.video-info p {
    color: #e2e8f0;
    font-size: 0.95em;
    margin: 0 0 1.2rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-meta span {
    color: #7dd3fc;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-duration,
.video-views {
    color: #e2e8f0 !important;
    font-size: 0.85em !important;
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
    margin-left: auto;
}

.watch-btn:hover {
    color: #7dd3fc;
}

.watch-btn i {
    font-size: 0.8em;
}

/* Loading Animation for Content */
.video-info h3.loading,
.video-info p.loading {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.video-info h3.loading {
    height: 1.5em;
    width: 80%;
    margin-bottom: 1rem;
}

.video-info p.loading {
    height: 1em;
    width: 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .videos-section {
        padding: 100px 3% 40px;
    }

    .video-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-buttons {
        justify-content: center;
    }

    .videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .video-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .watch-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        background: rgba(125, 211, 252, 0.1);
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .section-header h1 {
        font-size: 2em;
    }

    .video-info {
        padding: 1rem;
    }

    .video-meta {
        gap: 0.8rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#youtube-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

/* Custom Controls */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal-content:hover .custom-controls {
    opacity: 1;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 2px;
    margin-bottom: 10px;
}

.progress-filled {
    width: 0;
    height: 100%;
    background: #7dd3fc;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.controls-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.controls-main button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.controls-main button:hover {
    color: #7dd3fc;
}

.time {
    color: #fff;
    font-size: 14px;
    display: flex;
    gap: 4px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 2px;
    position: relative;
}

.volume-filled {
    width: 100%;
    height: 100%;
    background: #7dd3fc;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(125, 211, 252, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.play-button-overlay i {
    color: #000428;
    font-size: 24px;
    margin-left: 4px;
}

.video-thumbnail:hover .play-button-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}