/* ============================================================
   REELS WIDGET CSS - Anasayfa story overlay + home grid
   Global reset YOK - sadece reels bileşenleri
   ============================================================ */

/* Story Overlay */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #000;
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.story-overlay.active {
    display: flex;
}

/* Story Progress Bar */
.story-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    overflow: hidden;
    position: relative;
}

.story-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.story-progress-fill.played {
    width: 100%;
    background: rgba(255,255,255,0.7);
}

/* Story Top Bar */
.story-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent);
}

.story-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 16px 12px;
    color: #fff;
}

.story-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: background 0.2s;
    border: none;
    outline: none;
    cursor: pointer;
}
.story-close-btn:hover { background: rgba(255,255,255,0.25); }

.story-top-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.story-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-sound-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: background 0.2s;
    border: none;
    outline: none;
    cursor: pointer;
}
.story-sound-btn:hover { background: rgba(255,255,255,0.25); }

/* Story Container */
.story-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.story-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.story-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.story-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.story-video,
.story-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: 100%;
}

.story-youtube-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.story-media-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, transparent 30%, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.story-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.story-slide.paused .story-play-btn { opacity: 1; }

/* Navigasyon bölgeleri */
.story-nav-left,
.story-nav-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 10;
    cursor: pointer;
}
.story-nav-left { left: 0; }
.story-nav-right { right: 0; }

/* Çarpı Kapatma Butonu (sağ orta - dışarıda) */
.story-close-x {
    position: absolute;
    top: 50%;
    right: -24px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: all 0.2s ease;
    opacity: 0.8;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.story-close-x:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}
.story-close-x:active {
    transform: translateY(-50%) scale(0.95);
}
@media (min-width: 768px) {
    .story-close-x {
        right: -28px;
        width: 46px;
        height: 46px;
    }
}

/* Belirgin Navigasyon Butonları (sol/sağ ok) */
.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all 0.2s ease;
    opacity: 0.7;
}
.story-nav-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}
.story-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}
.story-nav-prev {
    left: 12px;
}
.story-nav-next {
    right: 12px;
}

/* Masaüstünde butonlar container dışında kalsın */
@media (min-width: 768px) {
    .story-nav-prev {
        left: calc(50% - 230px);
    }
    .story-nav-next {
        right: calc(50% - 230px);
    }
    .story-nav-btn {
        width: 48px;
        height: 48px;
        opacity: 0.5;
    }
    .story-nav-btn:hover {
        opacity: 1;
    }
}

/* Story Actions */
.story-actions {
    position: absolute;
    right: 12px;
    bottom: 120px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.story-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 22px;
    transition: transform 0.2s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    border: none;
    outline: none;
    cursor: pointer;
    background: none;
}
.story-action-btn:active { transform: scale(0.85); }
.story-action-btn svg {
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(2px);
    transition: background 0.2s;
}
.story-action-btn:hover svg { background: rgba(255,255,255,0.2); }

.story-action-count {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.story-like-btn.liked svg {
    color: #ff3040;
    fill: #ff3040;
    animation: storyLikePop 0.4s ease;
}
@keyframes storyLikePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Story Info */
.story-info {
    position: absolute;
    left: 16px;
    right: 72px;
    bottom: 32px;
    z-index: 10;
    color: #fff;
}

.story-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.story-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.5);
}

.story-user-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-caption { margin-bottom: 4px; }

.story-product-link {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}
.story-product-link:hover { text-decoration: underline; color: #fff; }

/* Story Loader */
.story-loader {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.story-loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: storySpin 0.7s linear infinite;
}
@keyframes storySpin { to { transform: rotate(360deg); } }

/* Story Toast */
.story-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.story-toast.show { opacity: 1; }

/* Kalp patlaması */
@keyframes storyFloatHeart {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}
.story-heart-burst {
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    animation: storyFloatHeart 0.8s ease forwards;
}

/* Masaüstü story viewer */
@media (min-width: 768px) {
    .story-overlay.active {
        background: rgba(0,0,0,0.95);
        align-items: center;
        justify-content: center;
    }
    .story-container {
        max-width: 420px;
        max-height: 90vh;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
    .story-progress-bar {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
    }
    .story-top-bar {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 12px 12px 0 0;
    }
    .story-actions { right: calc(50% - 198px); }
    .story-info { left: calc(50% - 192px); right: calc(50% - 140px); }
    .story-sound-btn { right: calc(50% - 198px); }
    .story-loader { left: calc(50% + 150px); }
}

/* ============================================================
   HOME WIDGET - Enterprise Tasarım
   ============================================================ */
.reels-home-section {
    padding: 48px 0;
    background: #f8f9fc;
    border-top: 1px solid #eef0f5;
    border-bottom: 1px solid #eef0f5;
}

.reels-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.reels-section-header-left {
    flex: 1;
}

.reels-heading {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.reels-subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.5;
}

.reels-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

.reels-view-all-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.reels-view-all-btn svg {
    transition: transform 0.2s ease;
}

.reels-view-all-btn:hover svg {
    transform: translateX(3px);
}

/* Grid */
.reels-home-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

@media(max-width:1200px){.reels-home-grid{grid-template-columns:repeat(4, 1fr)}}
@media(max-width:992px){.reels-home-grid{grid-template-columns:repeat(3, 1fr);gap:12px}}
@media(max-width:768px){
    .reels-home-section{padding:32px 0}
    .reels-home-grid{grid-template-columns:repeat(2, 1fr);gap:10px}
    .reels-section-header{flex-direction:column;align-items:flex-start;gap:12px;margin-bottom:20px}
    .reels-heading{font-size:20px}
}
@media(max-width:480px){.reels-home-grid{grid-template-columns:repeat(2, 1fr);gap:8px}}

/* Kartlar */
.reels-home-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #eef0f5;
    cursor: pointer;
}

.reels-home-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    border-color: #d0d5dd;
    transform: translateY(-2px);
    text-decoration: none;
}

.reels-home-media {
    position: relative;
    width: 100%;
    padding-top: 140%;
    overflow: hidden;
    background: #f1f5f9;
}

.reels-home-video,
.reels-home-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.reels-home-card:hover .reels-home-video,
.reels-home-card:hover .reels-home-img {
    transform: scale(1.05);
}

.reels-home-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.reels-home-card:hover .reels-home-overlay {
    opacity: 1;
}

.reels-home-play-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.85);
    transition: transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.reels-home-card:hover .reels-home-play-icon {
    transform: scale(1);
}

.reels-home-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    letter-spacing: 0.2px;
}

.reels-home-badge-video {
    background: rgba(30, 41, 59, 0.75);
}

.reels-home-info {
    padding: 10px 12px 12px;
}

.reels-home-title {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reels-home-price {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-top: 4px;
}
