/* ============================================
   PROFILE STORY VIEWER STYLES
   Kullanıcı sayfasında story görüntüleme
   ============================================ */

/* STORY HIGHLIGHTS SECTION */
.profile-story-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.story-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.story-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.story-count-badge {
    background: var(--accent);
    color: white;
    padding: 2px var(--spacing-md);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

/* STORY GRID (Horizontal Scroll) */
.story-highlights-grid {
    display: flex;
    gap: var(--spacing-lg);
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--spacing-sm) 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.story-highlights-grid::-webkit-scrollbar {
    height: 6px;
}

.story-highlights-grid::-webkit-scrollbar-track {
    background: var(--bg-primary-alt);
    border-radius: 10px;
}

.story-highlights-grid::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 10px;
}

.story-highlights-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* STORY ITEM */
.story-highlight-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

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

.story-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, var(--bg-gradient-start), var(--bg-gradient-end));
    box-shadow: var(--shadow-lg);
}

.story-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 3px;
    background: var(--bg-logo-zemin);
}

.story-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.story-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* EMPTY STATE */
.story-empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--text-tertiary);
}

.story-empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
    color: var(--text-tertiary);
}

.story-empty-text {
    font-size: 14px;
}

/* ============================================
   STORY VIEWER MODAL (Instagram Style)
   ============================================ */

.story-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.story-viewer-modal.active {
    display: flex;
    opacity: 1;
}

/* STORY CONTAINER (Instagram tarzı dikey format) */
.story-viewer-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: #000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* PROGRESS BARS (Üstte) */
.story-progress-bars {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    gap: 4px;
    z-index: 10;
}

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

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

.story-progress-bar.active .story-progress-fill {
    animation: progressFill 20s linear forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

.story-progress-bar.completed .story-progress-fill {
    width: 100%;
}

/* STORY HEADER (Profil bilgisi) */
.story-viewer-header {
    position: absolute;
    top: var(--spacing-lg);
    left: var(--spacing-md);
    right: 60px;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    z-index: 10;
    padding: var(--spacing-md);
    /*background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);*/
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.story-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.story-user-info {
    flex: 1;
}

.story-user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0;
    text-align: left;
}

.story-timestamp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: left;
}

/* CLOSE BUTTON */
.story-viewer-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    transition: all var(--transition-fast);
}

.story-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* STORY IMAGE */
.story-viewer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* STORY CAPTION (Altta) */
.story-viewer-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 80px 16px; /* ← Alt padding artır (nav bar için) */
    background: linear-gradient(0deg, 
        rgba(0,0,0,0.98) 0%, 
        rgba(0,0,0,0.85) 30%,
        rgba(0,0,0,0.5) 60%,
        transparent 100%
    );
    color: white;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    z-index: 10;
    max-height: 35%; /* ← Azalt */
    overflow-y: auto;
}

/* NAVIGATION ARROWS */
.story-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
}

.story-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.story-nav-arrow.prev {
    left: var(--spacing-lg);
}

.story-nav-arrow.next {
    right: var(--spacing-lg);
}

.story-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* STORY COUNTER (X / Y) */
.story-counter {
    position: absolute;
    bottom: 80px; /* ← Yukarı çek (eskisi: var(--spacing-lg)) */
    right: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10;
}

/* LOADING STATE */
.story-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9;
}

.story-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* TOUCH INTERACTION AREAS (Mobile için) */
.story-touch-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
    cursor: pointer;
}

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

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .story-viewer-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .story-nav-arrow {
        display: none; /* Mobile'da touch ile geçiş */
    }
    
    .story-highlights-grid {
        gap: var(--spacing-md);
    }
    
    .story-ring {
        width: 68px;
        height: 68px;
    }
    
    .profile-story-section {
        padding: 7px;
        margin: var(--spacing-lg) 0;
    }
}

/* DARK MODE STYLES - [data-theme="dark"] için */
[data-theme="dark"] .story-highlights-grid::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="dark"] .story-highlights-grid::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
}

[data-theme="dark"] .story-highlights-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

[data-theme="dark"] .story-ring {
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .story-ring-inner {
    background: var(--bg-secondary);
}

/* LIGHT MODE STYLES - [data-theme="light"] veya varsayılan */
[data-theme="light"] .story-highlights-grid::-webkit-scrollbar-track {
    background: var(--bg-primary-alt);
}

[data-theme="light"] .story-highlights-grid::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
}