/* ===============================================
   UX Enhancements - AI Story Club
   Merged from improvements.css + mobile-optimizations.css
   =============================================== */

/* ========== Profile Tabs ========== */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-link:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-placeholder {
    padding: 48px;
    text-align: center;
    color: var(--text-secondary);
}

.about-section {
    max-width: 800px;
}

.about-section h3 {
    margin-bottom: 24px;
}

.about-section h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* ========== Mobile Optimizations ========== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links .nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-mobile-menu {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 8px;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    .nav-user-name {
        display: none;
    }
}

/* ========== UX Enhancement Styles ========== */
/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    min-width: 320px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 72px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #f59e0b);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Fade In Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Hover Effects */
.story-card,
.comment-item,
.msg-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-card:hover,
.comment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Image Lazy Loading */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* ========== Desktop ========== */
@media (min-width: 769px) {
    .nav-mobile-menu {
        display: none;
    }
}
