/* ============================================
   STORY FEED - YouTube Shorts/Reels Stories
   ============================================ */

/* Story-Feed Container */
.story-feed-container {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0 8px 0;
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto;
}

.story-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 4px 20px;
}

.story-feed-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1a2a3a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-feed-header h3 i {
    color: #e4405f;
}

.story-count {
    background: #e4405f;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
}

.story-feed-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 20px 4px 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.story-feed-scroll::-webkit-scrollbar {
    display: none;
}

/* Einzelne Story */
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    gap: 6px;
    text-decoration: none;
    transition: transform 0.2s ease;
    min-width: 80px;
}

.story-item:hover {
    transform: translateY(-2px);
}

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

.story-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid #e4405f;
    padding: 3px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: border-color 0.2s;
}

.story-item:hover .story-avatar {
    border-color: #c62840;
}

.story-avatar-wrapper .story-live-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: #e4405f;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.story-name {
    font-size: 11px;
    color: #2d3748;
    max-width: 80px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    line-height: 1.3;
}

.story-place-type-badge {
    font-size: 9px;
    color: #6c757d;
    background: #f1f3f5;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   STORY MODAL
   ============================================ */

.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    animation: storyModalFadeIn 0.3s ease;
}

.story-modal.open {
    display: flex;
}

@keyframes storyModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.story-modal-inner {
    position: relative;
    max-width: 420px;
    width: 100%;
    margin: 0 16px;
}

.story-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.story-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Progress Bar */
.story-progress {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    display: flex;
    gap: 4px;
    padding: 0 16px;
    z-index: 10;
}

.story-progress .bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress .bar .fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
}

.story-progress .bar.active .fill {
    width: 100%;
    transition: width 30s linear;
}

/* Story Info - NUR Name */
.story-info {
    position: absolute;
    bottom: 100px;
    left: 20px;
    right: 20px;
    z-index: 10;
    color: white;
    text-align: center;
}

.story-info .story-place-name {
    font-size: 16px;
    font-weight: 700;
    display: block;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ============================================
   STORY LINK BUTTON - UNTEN
   ============================================ */

.story-link-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    width: 80%;
    max-width: 320px;
    display: none;  /* Wird von JavaScript überschrieben */
}

.story-link-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e4405f, #c62840);
    color: white;
    text-align: center;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 4px 24px rgba(228, 64, 95, 0.5);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.story-link-btn:hover {
    transform: scale(1.03);
    color: white;
    text-decoration: none;
}

.story-link-btn i {
    margin-right: 10px;
}

/* Close Button */
.story-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.story-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Navigation Buttons */
.story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.story-nav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.story-nav-prev {
    left: -12px;
}

.story-nav-next {
    right: -12px;
}

/* Touch Zones für mobile Navigation */
.story-touch-zone {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30%;
    z-index: 12;
    cursor: pointer;
}

.story-touch-zone-left {
    left: 0;
}

.story-touch-zone-right {
    right: 0;
}

/* ============================================
   RESPONSIVE - Mobile VOLLBILD
   ============================================ */

@media (max-width: 768px) {
    /* Feed */
    .story-avatar-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .story-avatar {
        border-width: 2.5px;
        padding: 2.5px;
        border-radius: 18px;
    }
    
    .story-avatar-wrapper .story-live-badge {
        width: 14px;
        height: 14px;
    }
    
    .story-name {
        font-size: 10px;
        max-width: 70px;
    }
    
    .story-feed-scroll {
        gap: 12px;
        padding: 0 12px 4px 12px;
    }
    
    .story-feed-header {
        padding: 0 12px 4px 12px;
    }
    
    /* MODAL - VOLLBILD */
    .story-modal {
        background: #000 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 99999 !important;
        animation: none !important;
    }
    
    .story-modal-inner {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: #000 !important;
        aspect-ratio: auto !important;
    }
    
    .story-video-wrapper {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        background: #000 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }
    
    .story-video-wrapper iframe {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border: 0 !important;
        background: #000 !important;
        object-fit: contain !important;
    }
    
    /* Navigation Buttons */
    .story-nav-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
        background: rgba(0,0,0,0.2) !important;
    }
    
    .story-nav-prev {
        left: 0 !important;
    }
    
    .story-nav-next {
        right: 0 !important;
    }
    
    .story-touch-zone {
        width: 25% !important;
    }
    
    .story-close-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 20px !important;
        top: 12px !important;
        right: 12px !important;
        background: rgba(0,0,0,0.5) !important;
        z-index: 25 !important;
    }
    
    .story-progress .bar {
        height: 4px !important;
    }
    
    .story-info {
        bottom: 80px !important;
        z-index: 15 !important;
    }
    
    .story-info .story-place-name {
        font-size: 18px !important;
    }
    
    .story-link-container {
        bottom: 30px !important;
        width: 85% !important;
    }
    
    .story-link-btn {
        padding: 16px 18px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 480px) {
    .story-avatar-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .story-avatar {
        border-width: 2px;
        padding: 2px;
        border-radius: 16px;
    }
    
    .story-avatar-wrapper .story-live-badge {
        width: 12px;
        height: 12px;
    }
    
    .story-name {
        font-size: 9px;
        max-width: 60px;
    }
    
    .story-feed-scroll {
        gap: 10px;
        padding: 0 10px 4px 10px;
    }
    
    .story-feed-header h3 {
        font-size: 12px;
    }
    
    .story-count {
        font-size: 10px;
        padding: 1px 8px;
    }
    
    .story-nav-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }
    
    .story-close-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        top: 10px !important;
        right: 10px !important;
    }
    
    .story-info .story-place-name {
        font-size: 16px !important;
    }
    
    .story-link-container {
        bottom: 25px !important;
        width: 90% !important;
    }
    
    .story-link-btn {
        padding: 14px 16px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .story-modal-inner {
        max-width: 420px;
        margin: 0 16px;
    }
}