﻿
/* Video Grid */
.videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem 1rem;
    padding: 1.5rem 0;
}

.video-card {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s; /* Add transition for hover effect */
}

    .video-card:hover {
        /*transform: scale(1.02);*/ /* Slightly scale up on hover */
        /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);*/ /* Add shadow effect */
    }

.thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
}

    .thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* viktiga inställningen */
        object-position: center;
        display: block;
    }


.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.01rem 0.3rem;
    border-radius: 5px;
    font-size: 0.7rem;
}

.video-info {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    object-fit: cover;
}

.video-details {
    flex: 1;
}

.video-title {
    font-weight: 600;
    line-height: 1.2rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: black;
}

html.dark .video-title {
    color: white;
}

.channel-name,
.video-stats {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .videos {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 960px) {
    .videos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header__search {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main {
        margin-left: 0;
    }

        .main.expanded {
            margin-left: 0;
        }
}

@media (max-width: 480px) {
    .videos {
        grid-template-columns: 1fr;
    }

    .header__left {
        gap: 1rem;
    }

    .header__icons {
        gap: 1rem;
    }
}

.search {
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border-radius: 20px;
    padding: 5px 10px;
    width: 60%;
}

    .search input {
        border: none;
        background: none;
        outline: none;
        flex: 1;
    }

    .search img {
        width: 20px;
        height: 20px;
    }

.mic img {
    width: 24px;
    height: 24px;
    margin-left: 10px;
}

.side-nav i {
    margin-left: 15px;
}

.tags {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
}

.tag {
    padding: 8px 16px;
    border-radius: 20px;
    margin-right: 10px;
    cursor: pointer;
    white-space: nowrap;
}

    .tag.dark {
        background-color: #000;
        color: #fff;
    }

    .tag.light {
        background-color: #f1f1f1;
        color: #000;
    }

.avatar-content {
    display: flex;
    align-items: center;
    padding: 10px;
}

.avatar {
    margin-right: 10px;
}

.content {
    flex: 1;
}

    .content h3 {
        margin: 0;
        font-size: 0.875rem;
    }

.channel-name {
    font-size: 0.875rem;
    color: #888;
}

.content-status {
    display: flex;
    gap: 10px;
    font-size: 0.875rem;
    color: #888;
}

.dots img {
    width: 20px;
    height: 20px;
}


/* */
.recordskeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem 1rem;
    padding: 1.5rem 0;
}

.video-card-skeleton {
    display: flex;
    flex-direction: column;
}

.thumbnail-skeleton {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
}

.skeleton {
    background: #f3f3f3;
    border-radius: 4px;
    animation: shimmer 1.5s infinite linear;
    background-image: linear-gradient(90deg, #f3f3f3 0%, #f9f9f9 50%, #f3f3f3 100%);
    background-size: 400% 100%;
}

html.dark .skeleton {
    background: #444;
    background-image: linear-gradient(90deg, #444 0%, #555 50%, #444 100%);
}

.skeleton-img {
    width: 100%;
    height: 100%;
}

.skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.skeleton-text {
    height: 12px;
    margin-top: 8px;
}

    .skeleton-text.short {
        width: 80%;
    }

    .skeleton-text.medium {
        width: 60%;
    }

    .skeleton-text.long {
        width: 40%;
    }

@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}



/* Responsive styles */
@media (max-width: 768px) {

    .card-container {
        display: flex;
        flex-direction: column;
    }

    .card {
        width: 100%;
    }

    .search {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .bars {
        margin-bottom: 10px;
    }

    .tags {
        flex-direction: column;
    }

    .tag {
        margin-bottom: 10px;
    }

    .center-nav {
        display: block;
    }

    .search {
        width: 100%;
    }

    nav {
        flex-direction: column;
    }
}

.video-item:after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 30px;
    height: 30px;
    background: url('/img/80px-video.png');
    background-size: cover;
    content: '';
    z-index: 1;
}

.rounded-25 {
    border-radius: 25px;
    padding-left: 20px;
}

/* Placera ikonen i högra hörnet av inputfältet */
.search-icon {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    color: #999;
    font-size: 1rem;
    pointer-events: none;
}

/* Gör extra padding på input så texten inte går in i ikonen */
#search-input {
    padding-right: 2.5rem;
}



/* Shorts 
           ---------------------------------------------------
        */
.shorts-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
}

    .shorts-grid::-webkit-scrollbar {
        display: none;
    }

.shorts-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


.short-card:hover {
    /* transform: scale(1.03); */
}

.short-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    background: #000;
}

.short-card {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .short-card::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 50%;
        background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
        pointer-events: none;
        z-index: 1; /* gradient ovanpå bilden */
    }

.short-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    max-width: calc(100% - 20px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 2; /* text ovanpå gradienten */
}

@media (max-width: 1280px) {
    .short-card {
        width: 210px;
        height: 320px;
    }
}

@media (max-width: 960px) {
    .short-card {
        width: 190px;
        height: 277px;
    }
}

@media (max-width: 465px) {
    .short-card {
        width: 165px;
        height: 245px;
    }
}
