/* =====================================================
   VIDEO THUMBNAIL IMAGE STYLES
   =====================================================
   Styling för thumbnails på videokort
   ===================================================== */

/* VIKTIGT: Thumbnail-container måste ha position relative och fixed height */
.video-thumbnail,
[class*="-video-thumbnail"] {
    position: relative;
    overflow: hidden;
    /* Säkerställ att thumbnails har rätt höjd */
    min-height: 150px;
    max-height: 200px;
}

/* Thumbnail-bild i videokort */
.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    transition: transform 0.3s ease;
    border-radius: inherit;
}

/* Zoom-effekt vid hover */
.video-card:hover .video-thumbnail-img,
[class*="-video-card"]:hover .video-thumbnail-img {
    transform: scale(1.05);
}

/* Badges och play-knapp ÖVER thumbnail */
.video-thumbnail .video-duration,
.video-thumbnail .video-category-badge,
.video-thumbnail .play-button,
[class*="-video-thumbnail"] .video-duration,
[class*="-video-thumbnail"] .video-category-badge,
[class*="-video-thumbnail"] .play-button {
    position: absolute;
    z-index: 2;
}

/* Duration badge i hörnet */
.video-thumbnail .video-duration,
[class*="-video-thumbnail"] .video-duration {
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* Category badge */
.video-thumbnail .video-category-badge,
[class*="-video-thumbnail"] .video-category-badge {
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
}

/* Play-knapp centrerad */
.video-thumbnail .play-button,
[class*="-video-thumbnail"] .play-button {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(229, 9, 20, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-card:hover .play-button,
[class*="-video-card"]:hover .play-button {
    opacity: 1;
}

.video-card:hover .play-button:hover,
[class*="-video-card"]:hover .play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(229, 9, 20, 1);
}

/* Emoji-ikon när ingen thumbnail finns */
.thumbnail-icon,
.thumbnail-fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    z-index: 1;
}

/* =====================================================
   STARTSIDAN - FORTSÄTT TITTA KORT
   Helt ny layout som matchar ämnessidans kort
   ===================================================== */

/* Ändra kortets layout från horisontell till vertikal */
#continueWatchingRow .video-card {
    min-width: 280px !important;
    max-width: 320px !important;
    width: 300px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95)) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Thumbnail-sektionen - SEPARAT från text */
#continueWatchingRow .video-card .video-thumbnail {
    position: relative !important;
    width: 100% !important;
    height: 170px !important;
    min-height: 170px !important;
    max-height: 170px !important;
    flex-shrink: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
}

/* Thumbnail-bilden */
#continueWatchingRow .video-card .video-thumbnail-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 0 !important;
}

/* Video-info UNDER thumbnail, INTE ovanpå */
#continueWatchingRow .video-card .video-info {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    background: transparent !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    flex-grow: 1 !important;
}

#continueWatchingRow .video-card .video-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.3 !important;
    margin-bottom: 0 !important;
}

#continueWatchingRow .video-card .video-description {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 1 !important;
    margin-bottom: 0 !important;
}

#continueWatchingRow .video-card .video-meta {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-top: 4px !important;
    opacity: 1 !important;
}

/* Progress bar längst ner på kortet */
#continueWatchingRow .video-card .progress-bar {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 4px !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin-top: auto !important;
}

#continueWatchingRow .video-card .progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #e50914;
    width: inherit;
    border-radius: 0 0 0 16px;
}

/* Duration badge */
#continueWatchingRow .video-card .video-duration {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    background: rgba(0, 0, 0, 0.85) !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    z-index: 5 !important;
}

/* Play-knapp centrerad i thumbnail */
#continueWatchingRow .video-card .play-button {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: #000 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 5 !important;
}

#continueWatchingRow .video-card:hover .play-button {
    opacity: 1 !important;
}

/* Thumbnail ikon när ingen bild finns */
#continueWatchingRow .video-card .thumbnail-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 40px !important;
    z-index: 1 !important;
}

/* Hover-effekt */
#continueWatchingRow .video-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
}

#continueWatchingRow .video-card:hover .video-thumbnail-img {
    transform: scale(1.05) !important;
}

/* Justera för mindre skärmar */
@media (max-width: 768px) {
    #continueWatchingRow .video-card {
        min-width: 260px !important;
        max-width: 280px !important;
        width: 270px !important;
    }
    
    #continueWatchingRow .video-card .video-thumbnail {
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
    }
    
    #continueWatchingRow .video-card .video-info {
        padding: 12px !important;
    }
    
    #continueWatchingRow .video-card .video-title {
        font-size: 14px !important;
    }
}

/* =====================================================
   LIGHT MODE
   ===================================================== */

body.light-mode .video-thumbnail .video-duration,
body.light-mode [class*="-video-thumbnail"] .video-duration {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body.light-mode .video-thumbnail .video-category-badge,
body.light-mode [class*="-video-thumbnail"] .video-category-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body.light-mode #continueWatchingRow .video-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 245, 250, 0.95)) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-mode #continueWatchingRow .video-card .video-title {
    color: #333 !important;
}

body.light-mode #continueWatchingRow .video-card .video-description {
    color: rgba(0, 0, 0, 0.7) !important;
}

body.light-mode #continueWatchingRow .video-card .video-meta {
    color: rgba(0, 0, 0, 0.6) !important;
}

body.light-mode #continueWatchingRow .video-card .play-button {
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
}