/* Stories Page Unique Styles */

/* Hero with Animated Background */
.stories-hero {
    background: linear-gradient(135deg, #FFF9F0 0%, #F5F5F5 100%);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.stories-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="10" y="50" font-family="serif" font-size="60" fill="rgba(212,175,55,0.05)">✡</text><text x="60" y="90" font-family="serif" font-size="40" fill="rgba(212,175,55,0.05)">☩</text></svg>');
    animation: float-pattern 30s linear infinite;
}

@keyframes float-pattern {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(360deg); }
}

.stories-hero h1 {
    color: #1A1A1A;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.stories-hero .lead {
    color: #374151;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

/* Timeline Layout for Stories */
.stories-timeline {
    position: relative;
    padding: 4rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #D4AF37, #B8941F);
    transform: translateX(-50%);
}

.story-timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 4rem;
    position: relative;
}

.story-timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 4px solid #D4AF37;
    border-radius: 50%;
    z-index: 2;
}

.story-card-timeline {
    width: 45%;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease;
}

.story-timeline-item:nth-child(odd) .story-card-timeline {
    margin-right: auto;
    margin-left: 2rem;
}

.story-timeline-item:nth-child(even) .story-card-timeline {
    margin-left: auto;
    margin-right: 2rem;
}

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

.story-era {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    color: #B8941F;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.story-card-timeline h3 {
    font-size: 1.5rem;
    color: #2C3E50;
    margin-bottom: 1rem;
}

.story-difficulty {
    display: flex;
    gap: 0.25rem;
    margin: 1rem 0;
}

.difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #E8ECF0;
}

.difficulty-dot.active {
    background: #D4AF37;
}

/* Interactive Story Cards */
.story-interactive-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 400px;
}

.story-interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.story-interactive-card:hover::before {
    opacity: 0.8;
}

.story-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-interactive-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: #ffffff;
    z-index: 2;
}

.story-interactive-content h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.story-meta-info {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.story-meta-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filter Tabs */
.story-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border: 2px solid #E8ECF0;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: #D4AF37;
    color: #B8941F;
}

.filter-tab.active {
    background: #1A1A1A;
    color: #ffffff;
    border-color: #1A1A1A;
}

/* Story Progress Tracker */
.story-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

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

.progress-fill {
    height: 100%;
    background: #D4AF37;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
    
    .story-timeline-item {
        flex-direction: column !important;
        margin-left: 40px;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .story-card-timeline {
        width: 100%;
        margin: 0 !important;
    }
    
    .stories-hero h1 {
        font-size: 2rem;
    }
}

/* Loading Animation */
.story-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.story-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #E8ECF0;
    border-top-color: #D4AF37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Story Card for Grid View */
.story-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    height: 440px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.story-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.story-card-content {
    padding: 1.5rem;
    height: calc(100% - 200px);
    display: flex;
    flex-direction: column;
}

.story-category {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    color: #B8941F;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.story-card h3 {
    font-size: 1.25rem;
    color: #1A1A1A;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.story-subtitle {
    color: #D4AF37;
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.story-card p {
    color: #6B7280;
    font-size: 0.875rem;
    line-height: 1.5;
    flex-grow: 1;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #F0F0F0;
    font-size: 0.75rem;
    color: #9CA3AF;
}

/* Placeholder for missing images */
.story-card-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #FFF9F0 0%, #F5E6D3 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.story-card-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: float-pattern 30s linear infinite;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
    z-index: 1;
    position: relative;
}

.placeholder-text {
    font-size: 1rem;
    font-weight: 600;
    color: #B8941F;
    opacity: 0.8;
    z-index: 1;
    position: relative;
    max-width: 80%;
    text-align: center;
    line-height: 1.3;
}

/* Different gradient colors for variety */
.story-card:nth-child(4n+1) .story-card-placeholder {
    background: linear-gradient(135deg, #FFF9F0 0%, #F5E6D3 100%);
}

.story-card:nth-child(4n+2) .story-card-placeholder {
    background: linear-gradient(135deg, #F5F3FF 0%, #E5DEFF 100%);
}

.story-card:nth-child(4n+3) .story-card-placeholder {
    background: linear-gradient(135deg, #FFF0F5 0%, #FFD6E8 100%);
}

.story-card:nth-child(4n) .story-card-placeholder {
    background: linear-gradient(135deg, #F0FFF4 0%, #D3F9D8 100%);
}

/* Add subtle pattern overlay */
.story-card-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(255, 255, 255, 0.1) 35px,
            rgba(255, 255, 255, 0.1) 70px
        );
    opacity: 0.5;
}