/* User-Friendly Improvements */

/* Stories Header */
.stories-header {
    text-align: center;
    margin: 40px 0;
    padding: 0 20px;
}

.stories-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.stories-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

/* Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.story-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.story-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.story-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-card:hover .story-overlay {
    opacity: 1;
}

.story-overlay i {
    font-size: 24px;
}

.story-content {
    padding: 20px;
}

.story-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.story-summary {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.story-level {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.read-time {
    color: #999;
    font-size: 0.9rem;
}

.read-time i {
    margin-right: 5px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 50px 0;
    padding: 0 20px;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background: white;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.prev-btn, .next-btn {
    padding: 12px 20px;
    font-weight: 600;
}

/* Loading States */
.story-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.story-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .stories-title {
        font-size: 2rem;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 20px;
    }
    
    .story-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .prev-btn, .next-btn {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .stories-header {
        margin: 20px 0;
    }
    
    .stories-title {
        font-size: 1.8rem;
    }
    
    .stories-subtitle {
        font-size: 1rem;
    }
    
    .story-content {
        padding: 15px;
    }
    
    .story-title {
        font-size: 1.2rem;
    }
}

/* Accessibility Improvements */
.story-card:focus-within {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.page-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-card {
    animation: fadeInUp 0.6s ease forwards;
}

.story-card:nth-child(1) { animation-delay: 0.1s; }
.story-card:nth-child(2) { animation-delay: 0.2s; }
.story-card:nth-child(3) { animation-delay: 0.3s; }
.story-card:nth-child(4) { animation-delay: 0.4s; }
.story-card:nth-child(5) { animation-delay: 0.5s; }
.story-card:nth-child(6) { animation-delay: 0.6s; }

/* Progress Indicators */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Improved Focus States */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Better Error States */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
    border-left: 4px solid #c62828;
}

/* Success States */
.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
    border-left: 4px solid #4caf50;
}