/* Instagram Stories System - Unique CSS Classes */

/* Stories Section */
.instagram-stories-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instagram-stories-container {
    max-width: 1400px;
    margin: 0 auto;
}

.instagram-stories-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.instagram-stories-grid::-webkit-scrollbar {
    display: none;
}

/* Story Items */
.instagram-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.instagram-story-item:hover {
    transform: scale(1.05);
}

/* İzlenen story'ler için Instagram tarzı tasarım */
.instagram-story-item.instagram-story-viewed .instagram-story-avatar-border {
    background: #dbdbdb !important;
    border: 2px solid #dbdbdb !important;
    animation: none !important;
}

.instagram-story-item.instagram-story-viewed .instagram-story-indicator {
    display: none !important;
}

.instagram-story-item.instagram-story-viewed .instagram-story-avatar-img {
    opacity: 0.7;
    filter: grayscale(30%);
}

.instagram-story-item.instagram-story-viewed .instagram-story-name {
    opacity: 0.7;
}

/* Story Avatar */
.instagram-story-avatar {
    position: relative;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-story-avatar-border {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e91e63;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-story-avatar-border::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.instagram-story-avatar-border:hover {
    transform: scale(1.1);
}

.instagram-story-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #f0f0f0;
    position: relative;
    z-index: 2;
}

/* Story Indicator */
.instagram-story-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    animation: instagramStoryPulse 2s infinite;
}

.instagram-story-indicator::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: #000;
    border-radius: 50%;
}

.instagram-story-indicator::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 50%;
}

@keyframes instagramStoryPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Story Name */
.instagram-story-name {
    color: white;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Viewed Badge */
.instagram-story-viewed-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* No Stories */
.instagram-no-stories {
    text-align: center;
    color: white;
    padding: 40px;
    font-size: 16px;
    opacity: 0.8;
}

/* Instagram Story Modal */
.instagram-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.instagram-story-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 700px;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.instagram-story-progress-bars {
    display: flex;
    gap: 4px;
    width: 100%;
}

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

.instagram-story-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: none;
    transform-origin: left;
}

.instagram-story-progress-bar.active {
    animation: instagramStoryProgress 5s linear forwards;
    width: 100%;
}

@keyframes instagramStoryProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Header */
.instagram-story-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px 16px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
    z-index: 5;
}

.instagram-story-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.instagram-story-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
}

.instagram-story-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instagram-story-user-details {
    color: #fff;
}

.instagram-story-user-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.instagram-story-time {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.instagram-story-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.instagram-story-profile-link {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.instagram-story-profile-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.instagram-story-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-story-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Story Content */
.instagram-story-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.instagram-story-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.instagram-story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-story-slide.active {
    opacity: 1;
}

.instagram-story-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.instagram-story-caption {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
}

/* Navigation */
.instagram-story-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 5;
}

.instagram-story-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-story-modal:hover .instagram-story-nav-btn {
    opacity: 1;
}

.instagram-story-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .instagram-stories-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .instagram-stories-grid {
        gap: 15px;
    }

    .instagram-story-item {
        min-width: 60px;
    }

    .instagram-story-avatar {
        width: 56px;
        height: 56px;
    }

    .instagram-story-avatar-border {
        width: 50px;
        height: 50px;
    }

    .instagram-story-name {
        font-size: 11px;
        max-width: 60px;
    }

    .instagram-story-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .instagram-story-progress-container {
        padding: 12px;
    }

    .instagram-story-header {
        padding: 50px 12px 12px;
    }

    .instagram-story-navigation {
        padding: 0 12px;
    }

    .instagram-story-nav-btn {
        width: 36px;
        height: 36px;
        opacity: 1;
    }
}

/* Touch Areas for Mobile */
.instagram-story-content {
    position: relative;
}

.instagram-story-touch-area {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 10;
}

.instagram-story-touch-area.instagram-story-prev-area {
    left: 0;
}

.instagram-story-touch-area.instagram-story-next-area {
    right: 0;
}

/* Loading Animation */
.instagram-story-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    z-index: 15;
}

/* Error State */
.instagram-story-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    z-index: 15;
}

.instagram-story-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.instagram-story-error-message {
    font-size: 16px;
    opacity: 0.8;
}
