/**
 * Security News and Video Feed Styles
 * Enhanced styling for auto-updating content feeds
 */

/* ============================================
   VIDEO GRID LAYOUT
   ============================================ */

.featured-videos {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 2rem;
}

.featured-videos h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--slate-100);
    margin-bottom: 2rem;
    text-align: center;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.25);
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(249, 115, 22, 0.1));
    text-decoration: none;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(249, 115, 22, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

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

/* Video Info */
.video-info {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.video-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-100);
    margin-bottom: 0.6rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    color: var(--slate-400);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    flex-grow: 1;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--slate-500);
    padding-top: 0.8rem;
    border-top: 1px solid var(--glass-border);
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

.news-card.loading,
.video-card.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.news-card.loading::after,
.video-card.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

/* ============================================
   REFRESH INDICATOR
   ============================================ */

.content-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--neon-green);
    margin: 1rem 0;
    animation: fadeIn 0.4s ease;
}

.refresh-icon {
    display: inline-block;
    animation: spin 2s linear infinite;
}

.refresh-icon.done {
    animation: none;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .featured-videos {
        padding: 1.5rem;
    }

    .featured-videos h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }

    .video-info {
        padding: 1rem;
    }

    .video-info h4 {
        font-size: 0.95rem;
    }

    .play-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 640px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .featured-videos h2 {
        font-size: 1.3rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.video-card:focus-within {
    outline: 2px solid var(--electric-blue);
    outline-offset: 2px;
}

.video-thumbnail:focus {
    outline: 2px solid var(--electric-blue);
    outline-offset: 2px;
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .video-card {
        background: rgba(26, 11, 46, 0.4);
    }

    .video-card:hover {
        background: rgba(26, 11, 46, 0.6);
    }
}

/* Animation preferences */
@media (prefers-reduced-motion: reduce) {
    .video-card,
    .video-thumbnail img,
    .play-button,
    .refresh-icon {
        animation: none !important;
        transition: background-color 0.2s ease !important;
    }
}
