/* ===== OUR WORK PROGRAMS CSS ===== */

/* Container */
.aceo-programs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.aceo-our-work-hero {
    text-align: center;
    padding: 100px 0;
    background: linear-gradient(135deg, #0d2818 0%, #1A5F23 100%);
    color: white;
    margin-bottom: 60px;
    border-bottom: 3px solid #D4AF37;
}

.aceo-our-work-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto 40px;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat {
    text-align: center;
    padding: 20px;
}

.hero-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #D4AF37;
    margin-bottom: 10px;
    line-height: 1;
}

.hero-stat .stat-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Impact Metrics */
.aceo-impact-metrics {
    background: linear-gradient(135deg, #0d2818, #1A5F23);
    color: white;
    padding: 80px 0;
    margin: 60px 0;
    border-radius: 20px;
}

.metrics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.metric-card {
    text-align: center;
}

.metric-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.metric-value {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #D4AF37;
}

.metric-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Program Categories */
.aceo-program-categories {
    margin: 80px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-10px);
    border-color: #1A5F23;
    box-shadow: 0 20px 40px rgba(26, 95, 35, 0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #1A5F23;
}

.category-card h3 {
    color: #0d2818;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.category-card p {
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.btn-view-category {
    display: inline-block;
    background: #1A5F23;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid #1A5F23;
    transition: all 0.3s ease;
}

.btn-view-category:hover {
    background: #0d2818;
    border-color: #0d2818;
    transform: translateY(-2px);
}

/* Filters */
.aceo-programs-filters {
    background: #F8FAF9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid #E2E8F0;
}

.aceo-programs-filters .filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.aceo-programs-filters .filter-group label {
    display: block;
    font-weight: 600;
    color: #0d2818;
    margin-bottom: 8px;
}

.aceo-programs-filters select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.aceo-programs-filters select:focus {
    outline: none;
    border-color: #1A5F23;
}

.aceo-reset-filters {
    background: transparent;
    color: #E53E3E;
    padding: 12px 25px;
    border: 2px solid #E53E3E;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: end;
}

.aceo-reset-filters:hover {
    background: #E53E3E;
    color: white;
}

/* Programs Grid */
.aceo-programs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.aceo-programs-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.aceo-programs-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Program Card */
.aceo-program-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aceo-program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(26, 95, 35, 0.15);
    border-color: #1A5F23;
}

.program-card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

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

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

.program-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.status-active { background: #38A169; }
.status-completed { background: #D4AF37; }
.status-planned { background: #4A5568; }
.status-pilot { background: #805AD5; }

.program-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.program-title {
    font-size: 1.3rem;
    color: #0d2818;
    margin-bottom: 15px;
    line-height: 1.4;
}

.program-title a {
    color: inherit;
    text-decoration: none;
}

.program-title a:hover {
    color: #1A5F23;
}

.program-excerpt {
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    font-size: 0.95rem;
}

.program-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #4A5568;
    font-size: 0.9rem;
}

.meta-icon {
    width: 24px;
    text-align: center;
}

.program-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-program-view {
    flex: 1;
    background: #1A5F23;
    color: white;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-program-view:hover {
    background: #0d2818;
}

.btn-program-donate {
    flex: 1;
    background: #E53E3E;
    color: white;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-program-donate:hover {
    background: #C53030;
}

/* Impact Stories */
.aceo-impact-stories {
    margin: 80px 0;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.stories-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.stories-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.impact-story-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.impact-story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(26, 95, 35, 0.15);
}

.story-image {
    height: 250px;
    overflow: hidden;
}

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

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

.story-content {
    padding: 25px;
}

.story-category {
    display: inline-block;
    background: rgba(26, 95, 35, 0.1);
    color: #1A5F23;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.story-title {
    font-size: 1.4rem;
    color: #0d2818;
    margin-bottom: 15px;
    line-height: 1.4;
}

.story-title a {
    color: inherit;
    text-decoration: none;
}

.story-title a:hover {
    color: #1A5F23;
}

.story-excerpt {
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.btn-story-read {
    display: inline-block;
    background: transparent;
    color: #1A5F23;
    padding: 10px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid #1A5F23;
    transition: all 0.3s ease;
}

.btn-story-read:hover {
    background: #1A5F23;
    color: white;
}

.stories-cta {
    text-align: center;
}

.btn-view-all-stories {
    display: inline-block;
    background: #1A5F23;
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid #1A5F23;
    transition: all 0.3s ease;
}

.btn-view-all-stories:hover {
    background: #0d2818;
    border-color: #0d2818;
    transform: translateY(-2px);
}

/* Section Titles */
.section-title {
    text-align: center;
    color: #0d2818;
    font-size: 2.5rem;
    margin: 60px 0 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #D4AF37;
}

/* Pagination */
.aceo-programs-pagination {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #E2E8F0;
}

.aceo-load-more-programs {
    background: #1A5F23;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.aceo-load-more-programs:hover:not(:disabled) {
    background: #0d2818;
    transform: translateY(-2px);
}

.aceo-load-more-programs.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.aceo-load-more-programs:disabled {
    background: #A0AEC0;
    cursor: not-allowed;
}

/* Empty States */
.aceo-no-programs,
.aceo-no-stories {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #E2E8F0;
    color: #718096;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .aceo-programs-grid,
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .aceo-programs-grid,
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aceo-programs-filters .filter-container {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .aceo-our-work-hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 30px;
    }
    
    .aceo-programs-grid,
    .stories-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .program-actions {
        flex-direction: column;
    }
    
    .metrics-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .aceo-our-work-hero h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .metrics-container {
        grid-template-columns: 1fr;
    }
    
    .metric-value {
        font-size: 2.5rem;
    }
    
    .program-image {
        height: 180px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Add these styles to your existing CSS file */

/* Category Badge */
.program-category-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(26, 95, 35, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Fix for status and category badge positioning */
.program-image {
    position: relative;
}

/* Active filter indicator */
.aceo-program-filter option[selected] {
    font-weight: bold;
    background: #1A5F23;
    color: white;
}

/* Loading state */
.aceo-load-more-programs.loading {
    position: relative;
    padding-left: 40px;
}

.aceo-load-more-programs.loading:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Improved filter dropdowns */
.aceo-programs-filters select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234A5568" width="18" height="18"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 45px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ===== IMPACT STORIES ARCHIVE PAGE STYLES ===== */

/* Hero Section for Archive */
.aceo-impact-stories-hero {
    text-align: center;
    padding: 100px 0;
    background: linear-gradient(135deg, #0d2818 0%, #1A5F23 100%);
    color: white;
    margin-bottom: 60px;
    border-bottom: 3px solid #D4AF37;
}

.aceo-impact-stories-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

/* Stories Filter */
.aceo-impact-stories-filter {
    background: #F8FAF9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid #E2E8F0;
}

.aceo-impact-stories-filter .filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.aceo-impact-stories-filter .filter-group label {
    display: block;
    font-weight: 600;
    color: #0d2818;
    margin-bottom: 8px;
}

.aceo-impact-stories-filter select,
.aceo-impact-stories-filter input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.aceo-impact-stories-filter input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234A5568" width="18" height="18"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 15px center;
    background-size: 18px;
    padding-left: 45px;
}

.aceo-reset-stories-filters {
    background: transparent;
    color: #E53E3E;
    padding: 12px 25px;
    border: 2px solid #E53E3E;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: end;
}

.aceo-reset-stories-filters:hover {
    background: #E53E3E;
    color: white;
}

/* Improved Story Card */
.impact-story-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.impact-story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(26, 95, 35, 0.15);
    border-color: #1A5F23;
}

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

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

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

.story-category-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(26, 95, 35, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.story-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #4A5568;
}

.story-year,
.story-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-title {
    font-size: 1.4rem;
    color: #0d2818;
    margin-bottom: 15px;
    line-height: 1.4;
}

.story-title a {
    color: inherit;
    text-decoration: none;
}

.story-title a:hover {
    color: #1A5F23;
}

.story-excerpt {
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    font-size: 0.95rem;
}

.btn-story-read {
    display: inline-block;
    background: transparent;
    color: #1A5F23;
    padding: 10px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid #1A5F23;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-story-read:hover {
    background: #1A5F23;
    color: white;
}

/* Stories Pagination */
.stories-pagination {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #E2E8F0;
    margin-top: 40px;
}

.aceo-load-more-stories {
    background: #1A5F23;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.aceo-load-more-stories:hover:not(:disabled) {
    background: #0d2818;
    transform: translateY(-2px);
}

.aceo-load-more-stories.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    padding-left: 40px;
}

.aceo-load-more-stories.loading:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.aceo-load-more-stories:disabled {
    background: #A0AEC0;
    cursor: not-allowed;
}

/* Show All Stories Button */
.btn-show-all-stories {
    background: #D4AF37;
    color: #1A202C;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-show-all-stories:hover:not(:disabled) {
    background: #b89422;
    transform: translateY(-2px);
}

.btn-show-all-stories:disabled {
    background: #A0AEC0;
    cursor: not-allowed;
}

/* View All Stories Button (in Our Work page) */
.stories-cta {
    text-align: center;
    margin-top: 40px;
}

.btn-view-all-stories {
    display: inline-block;
    background: #1A5F23;
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid #1A5F23;
    transition: all 0.3s ease;
}

.btn-view-all-stories:hover {
    background: #0d2818;
    border-color: #0d2818;
    transform: translateY(-2px);
}

/* Animation for spinning loader */
@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive Design for Stories */
@media (max-width: 768px) {
    .aceo-impact-stories-hero h1 {
        font-size: 2.5rem;
    }
    
    .aceo-impact-stories-filter .filter-container {
        grid-template-columns: 1fr;
    }
    
    .stories-grid[data-columns="3"] {
        grid-template-columns: 1fr;
    }
    
    .story-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .aceo-impact-stories-hero h1 {
        font-size: 2rem;
    }
    
    .aceo-load-more-stories,
    .btn-show-all-stories,
    .btn-view-all-stories {
        width: 100%;
        min-width: unset;
    }
}

/* ===== LOADING STATES & SPINNERS ===== */

/* Spinner for loading buttons */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.aceo-load-more-stories.loading .spinner,
.aceo-load-more-programs.loading .spinner {
    display: inline-block;
}

/* Button loading states */
.aceo-load-more-stories.loading,
.aceo-load-more-programs.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Count text in buttons */
.aceo-load-more-stories .count,
.aceo-load-more-programs .count {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-left: 8px;
    font-weight: normal;
}

/* No more stories message */
.aceo-no-more-stories {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #F8FAF9;
    border-radius: 12px;
    border: 2px dashed #E2E8F0;
    color: #718096;
    font-style: italic;
    margin: 20px 0;
}

/* Success message */
.stories-loaded-message {
    background: #38A169;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    display: none;
}

/* Animation for loading new items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aceo-program-card.new,
.impact-story-card.new {
    animation: fadeInUp 0.5s ease forwards;
}

/* Debug info (hidden by default) */
.aceo-debug-info {
    display: none;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
}