/* Beneficiary Success Stories - Styling
 * Government of Maharashtra - Gram Panchayat Guidelines Compliance
 * Phase 2 Implementation
 */

.stories-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.stories-hero {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #ff6b35 100%);
    padding: 60px 20px;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 40px;
    color: white;
}

.stories-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.stories-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.stories-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 12px 25px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #ff6b35;
    background: #fff3e0;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff6b35, #ff9800);
    color: white;
    border-color: #ff6b35;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.story-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.story-card.featured {
    border: 3px solid #ff9800;
}

.story-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
    z-index: 10;
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.story-content {
    padding: 25px;
}

.story-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #666;
}

.story-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.story-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-scheme {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.story-impact {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    margin-bottom: 15px;
}

.impact-label {
    font-size: 0.75rem;
    color: #2e7d32;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.impact-text {
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.story-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.story-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 0.85rem;
}

.read-more-btn {
    background: linear-gradient(135deg, #ff6b35, #ff9800);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Modal Styles */
.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.story-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f44336;
    transform: rotate(90deg);
}

.modal-header {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding: 40px;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.before-after-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.before-box,
.after-box {
    padding: 20px;
    border-radius: 15px;
}

.before-box {
    background: linear-gradient(135deg, #ffebee, #ffffff);
    border-left: 4px solid #f44336;
}

.after-box {
    background: linear-gradient(135deg, #e8f5e9, #ffffff);
    border-left: 4px solid #4caf50;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.before-box .section-label {
    color: #c62828;
}

.after-box .section-label {
    color: #2e7d32;
}

.video-container {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 400px;
    border: none;
}

.no-stories {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-stories-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .stories-grid {
        grid-template-columns: 1fr;
    }

    .stories-hero h1 {
        font-size: 1.8rem;
    }

    .before-after-section {
        grid-template-columns: 1fr;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 10px 18px;
    }
}

/* Loading Animation */
.stories-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {

    .stories-filters,
    .read-more-btn,
    .story-modal {
        display: none;
    }

    .story-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}