﻿/* =============== Değişkenler =============== */
:root {
    --footer-h: 64px; /* sabit alt bar yüksekliği */
    --gap-md: 12px;
    --gap-lg: 16px;
    --clr-blue: #007AFF;
    --clr-red: #d9534f;
    --clr-black: #000;
    --clr-white: #fff;
}

/* =============== Genel Bölüm =============== */
.video-section {
    background: #fff;
    border-radius: 0;
    padding: 15px;
    margin: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

/* Üst başlık */
.videolar-header {
    width: 100%;
    height: 46px;
    background: var(--clr-black);
    color: var(--clr-white);
    display: flex;
    align-items: center;
    padding-left: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-top: 1px solid var(--clr-blue);
}

/* =============== Liste =============== */
.video-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 16px;
    /* sabit footer ile çakışmayı önle */
    padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px) + 10px);
    box-sizing: border-box;
}

/* =============== Kart / Satır =============== */
.video-item {
    display: flex;
    align-items: flex-start;
    gap: var(--gap-md);
    position: relative;
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.video-list .video-item:last-child {
    border-bottom: 0;
}

/* =============== Thumbnail =============== */
.video-thumbnail-wrapper {
    flex: 0 0 140px;
    height: 78px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover play overlay (opsiyonel) */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.3);
    opacity: 0;
    transition: opacity .2s ease;
}

.video-thumbnail-wrapper:hover .play-overlay {
    opacity: 1;
}

.play-overlay img {
    width: 36px;
    height: 36px;
}

/* Başlık */
.video-title {
    flex: 1;
    display: block;
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

/* Sil Buton */
.video-item .delete-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    width: 36px; /* dokunma alanını büyüt */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    border-radius: 8px;
}

    .video-item .delete-btn img {
        width: 18px;
        height: 18px;
    }

/* Klavye erişilebilirliği */
button:focus-visible {
    outline: 2px solid var(--clr-blue);
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid var(--clr-blue);
    outline-offset: 2px;
    border-radius: 6px;
}

/* =============== Footer / Eylem Butonları =============== */
.video-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030; /* Bootstrap modal 1050'dir, altında kalsın */
    display: flex;
    justify-content: center;
    gap: var(--gap-md);
    padding: 8px var(--gap-lg) calc(8px + env(safe-area-inset-bottom, 0px));
    height: var(--footer-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(6px);
    border-top: 1px solid #e9e9e9;
    box-shadow: 0 -2px 6px rgba(0,0,0,.04);
}

    /* Footer’daki butonlar */
    .video-footer button {
        flex: 1;
        max-width: 220px; /* geniş ekranlarda çok büyümesin */
        height: 48px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: var(--clr-white);
        transition: opacity .2s ease, transform .15s ease, filter .15s ease;
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
    }

        .video-footer button:hover {
            opacity: .95;
            transform: translateY(-1px);
        }

        .video-footer button:active {
            transform: translateY(0);
            filter: brightness(.98);
        }

    .video-footer .toggle-add-btn {
        background: var(--clr-blue);
    }

    .video-footer .toggle-delete-btn {
        background: #e53935; /* kırmızı arka plan */
    }

    /* İkonları beyaz yap (ikon dosyan siyah/renkliyse) */
    .video-footer button img {
        width: 18px;
        height: 18px;
        filter: brightness(0) invert(1);
    }

/* =============== Responsive =============== */
@media (max-width: 600px) {
    .video-item {
        gap: 10px;
        padding: 10px 6px;
    }

    .video-thumbnail-wrapper {
        flex-basis: 120px;
        height: 68px;
    }

    .video-title {
        font-size: .95rem;
    }

    .video-footer button {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .video-thumbnail-wrapper {
        flex-basis: 114px;
        height: 64px;
    }
}

@media (max-width: 360px) {
    .video-thumbnail-wrapper {
        flex-basis: 108px;
        height: 60px;
    }

    .video-title {
        font-size: .9rem;
        line-height: 1.3;
    }
}

/* Netlik: bu bileşenlerde border/shadow kullanma */
.video-footer,
.video-footer .btn {
    border: 0 !important;
    box-shadow: none !important;
}
