/* ============================================
   VİDEO GALERİSİ SAYFASI - videolar.css
   Instagram-like Grid | Mobile-First
   Son Güncelleme: 08 Ocak 2025
============================================ */

/* ============================================
   ANA KONTEYNER
============================================ */
.video-gallery-page {
    min-height: 100vh;
    padding-bottom: 80px;
    background: var(--bg-primary);
}

/* ============================================
   HEADER
============================================ */
.gallery-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-btn:active {
    transform: scale(0.92);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.back-icon {
    font-size: 20px;
    font-weight: 700;
}

.header-info {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   VİDEO GRID - Instagram Style
============================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    animation: fadeIn 0.5s ease;
}

.video-item {
    position: relative;
    aspect-ratio: 9 / 16;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-item:active {
    transform: scale(0.95);
}

/* ============================================
   THUMBNAIL
============================================ */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gradient Overlay */
.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.5) 0%,
        transparent 40%
    );
    pointer-events: none;
}

/* ============================================
   PLAY ICON
============================================ */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.video-item:active .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.9);
}

/* ============================================
   DURATION BADGE
============================================ */
.duration-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}

/* ============================================
   LAZY LOADING
============================================ */
.load-more-trigger {
    height: 1px;
    margin: 20px 0;
    visibility: hidden;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 16px;
    color: var(--text-secondary);
}

.loading-spinner.hidden {
    display: none;
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner p {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

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

/* ============================================
   EMPTY STATE
============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    min-height: 50vh;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    max-width: 280px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   VIDEO MODAL (Mevcut profile-video stillerini kullan)
============================================ */
.profile-video-modal {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-video-modal.active {
    display: flex;
    opacity: 1;
}

.video-modal-close {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 100003;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.video-modal-close:active {
    transform: scale(0.9);
    background: rgba(255, 0, 0, 0.8);
}

.video-modal-viewer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#profileVideoPlayer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

#profileVideoPlayer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: white;
    z-index: 100002;
}

.video-loading.hidden {
    display: none;
}

.video-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.video-loading p {
    margin-top: 20px;
    font-size: 15px;
    font-weight: 500;
}

.video-info-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        transparent 100%
    );
    z-index: 100001;
    pointer-events: none;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.video-author-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.video-title {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
}

.video-counter {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 100002;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.video-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
    z-index: 100001;
}

.video-nav-arrow {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(129, 129, 129, 0.15);
    border-radius: 50%;
    color: rgb(112, 112, 112);
    font-size: 28px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-nav-arrow:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   RESPONSIVE - Tablet & Desktop
============================================ */

/* Büyük Mobil (390px+) */
@media (min-width: 390px) {
    .video-grid {
        gap: 6px;
        padding: 6px;
    }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .video-grid {
        gap: 8px;
        padding: 8px;
        max-width: 935px;
        margin: 0 auto;
    }
    
    .video-item {
        border-radius: 12px;
    }
    
    .video-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }
    
    .video-item:hover .play-icon {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    
    .gallery-header {
        padding: 20px 24px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .video-count {
        font-size: 14px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .video-grid {
        gap: 10px;
        padding: 10px;
    }
    
    .video-modal-close,
    .video-nav-arrow {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .video-modal-close:hover {
        background: rgba(255, 0, 0, 0.9);
        transform: rotate(90deg);
    }
    
    .video-nav-arrow:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }
}

/* ============================================
   DARK MODE UYUMU
============================================ */
[data-theme="dark"] .gallery-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .video-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ANIMASYONLAR
============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ACCESSIBILITY
============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .video-modal-close,
    .video-nav-arrow {
        border: 2px solid white;
        background: #000;
    }
}