:root {
    --primary-blue: #2b6cb0;
    --primary-green: #38a169;
    --white: #fff;
    --light-gray: #f7fafc;
    --dark-gray: #2d3748;
    --black: #000;
    --secondary-green: #2f855a;
    --text-color-medium: #4a5568;
    --text-color-light: #718096;
    --border-color: #e2e8f0;
    --shadow-light: rgba(43, 108, 176, 0.07);
    --shadow-medium: rgba(43, 108, 176, 0.15);

    /* New variables for consistency with previous updates */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 1.5rem;    /* 24px */
    --spacing-lg: 2rem;      /* 32px */
    --spacing-xl: 3rem;      /* 48px */
    --spacing-2xl: 4rem;     /* 64px */

    --border-radius-sm: 0.25rem; /* 4px */
    --border-radius-md: 0.5rem;  /* 8px */
    --border-radius-lg: 0.75rem; /* 12px */
    --border-radius-xl: 1rem;    /* 16px */
}

body {
    background: var(--light-gray);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-color-medium);
}

.all-activities-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow-light);
    padding: 5rem 4rem;
}

@media (max-width: 992px) {
    .all-activities-container {
        padding: 4rem 3rem;
        margin: 4rem 2rem;
    }
}

@media (max-width: 576px) {
    .all-activities-container {
        padding: 3rem 2rem;
        margin: 3rem 1rem;
        border-radius: 16px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h1 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--primary-green);
    font-size: 1.2rem;
    font-weight: 500;
}

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 40px;
    gap: 10px;
}

.search-bar input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-bar input[type="text"]::placeholder {
    color: var(--text-color-light);
}

.search-bar input[type="text"]:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
}

.search-bar button {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.search-bar button:hover {
    background-color: var(--primary-green);
    transform: translateY(-2px);
}

.search-bar button i {
    margin: 0;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch;
}

/* --- ACTIVITY CARD (TEXT OVERLAY) --- */
.activity-card {
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative; /* Crucial for absolute positioning of children */
    height: 380px; /* Fixed height for consistent overlay presentation */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Pushes content to the bottom */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid var(--border-color);
}

.activity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.activity-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.activity-card-link:focus .activity-card,
.activity-card-link:hover .activity-card {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    transform: translateY(-10px) scale(1.02);
}

.activity-card img { /* The image will be absolutely positioned */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1; /* Behind the overlay and content */
}

/* Gradient Overlay */
.activity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker gradient at the bottom for text readability */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    z-index: 2; /* On top of the image */
    pointer-events: none; /* Allows clicks to pass through */
}

.activity-info { /* This now becomes the main content container for the overlay */
    padding: 20px;
    position: relative; /* To position it above the overlay */
    z-index: 3; /* On top of the overlay */
    color: var(--white); /* All text inside should be white for contrast */
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Consistent spacing for elements */
    flex-grow: 1; /* Allows content to push to the bottom */
    justify-content: flex-end; /* Ensures content is at the bottom */
}

.activity-info h3 {
    color: var(--white); /* Title color */
    margin-bottom: 10px;
    font-size: 1.5rem; /* Slightly larger for impact */
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8); /* Stronger shadow for readability */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-location {
    color: rgba(255, 255, 255, 0.9); /* Lighter white */
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.activity-location i {
    margin-right: 8px;
    color: var(--primary-green); /* Icon color remains */
}

.activity-description {
    color: rgba(255, 255, 255, 0.8); /* Slightly less bright */
    margin-bottom: 15px;
    font-size: 1rem;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-dates {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9); /* Lighter white */
     /* Pushes it to the bottom */
    margin-bottom: 15px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.activity-dates p {
    margin-bottom: 5px;
}

.activity-dates i {
    margin-right: 8px;
    color: var(--primary-green); /* Icon color remains */
}

.btn-details { /* Renamed for clarity in this context if not used elsewhere */
    display: inline-block;
    background: var(--primary-green);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
    text-align: center;
    margin-top: auto; /* Ensure it stays at the bottom */
    align-self: flex-start; /* Aligns to the left */
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

.btn-details:hover {
    background: var(--secondary-green);
    transform: translateY(-2px);
}

/* --- END ACTIVITY CARD (TEXT OVERLAY) --- */

.pagination-controls {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 20px;
}

.pagination {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.page-item {
    margin: 0;
}

.page-link {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-color);
}

.page-item:last-child .page-link {
    border-right: none;
}

.page-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-green);
}

.page-item.active .page-link {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    cursor: default;
}

.page-item.active .page-link:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

.page-item.disabled .page-link {
    color: #a0aec0;
    pointer-events: none;
    background-color: var(--white);
    opacity: 0.6;
}

.loading,
.no-items-found,
.error-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2rem;
    color: var(--text-color-medium);
    grid-column: 1 / -1;
    font-weight: 500;
}

.error-message {
    color: #e53e3e;
    font-weight: 600;
}

.error-message i {
    margin-right: 10px;
    font-size: 1.1em;
}

.return-button-container {
    text-align: center;
    margin-top: 40px;
}

.return-button {
    background: #6c757d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.05rem;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.return-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

footer {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-section a {
    color: var(--white);
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--secondary-green);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section p {
    margin-bottom: 0.5rem;
}

.footer-section i {
    margin-right: 0.5rem;
    color: var(--secondary-green);
}

@media (max-width: 768px) {

    .section-header h1 {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .search-bar {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar input[type="text"] {
        max-width: 90%;
    }

    .search-bar button {
        width: 70%;
        max-width: 250px;
    }

    .activities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Adjusted for text overlay on smaller screens */
    .activity-card {
        height: 350px; /* Slightly reduced height for mobile */
    }

    .activity-info {
        padding: 15px; /* Reduced padding */
    }

    .activity-info h3 {
        font-size: 1.3rem; /* Slightly smaller title */
    }

    .activity-description,
    .activity-location,
    .activity-dates {
        font-size: 0.9rem; /* Adjusted text sizes */
    }

    .btn-details {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 0;
        box-shadow: none;
    }

    .page-item {
        margin: 5px 2px;
    }

    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        border-radius: 5px;
    }

    .page-link {
        border-right: 1px solid var(--border-color);
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .page-item:last-child .page-link {
        border-right: 1px solid var(--border-color);
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        width: 100%;
        padding: 1rem 0;
    }

    .footer-section h3 {
        font-size: 1.4rem;
    }

    .footer-social-links a {
        font-size: 1.5rem;
    }
}

.activity-btn {
    display: inline-block;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s ease;
    box-shadow: 0 4px 10px rgba(56, 161, 105, 0.3);
}

.activity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56, 161, 105, 0.5);
}

.activity-btn.active {
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.6);
}

@media (max-width: 576px) {
    .activity-btn {
        padding: 8px 18px;
        font-size: 0.95rem;
    }
}