/**
 * National Parks Page Styles
 * Comprehensive styling for the parks listing page
 */

/* ==========================================================================
   Parks Hero Section
   ========================================================================== */

.parks-hero {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(32, 201, 151, 0.9)),
                url('../images/ecosystems/savanna/Lion.jpg') center/cover;
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.parks-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.parks-hero .container {
    position: relative;
    z-index: 2;
}

.hero-stats {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

/* ==========================================================================
   Filter Section
   ========================================================================== */

.parks-filters {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
}

.filter-controls {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-box .input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-box .input-group-text {
    background: #9F4634;
    color: white;
    border: none;
}

.search-box .form-control {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.search-box .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.filter-options {
    align-items: end;
}

.filter-group {
    min-width: 150px;
}

.filter-group .form-label {
    color: #333333;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.filter-group .form-select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-group .form-select:focus {
    border-color: #9F4634;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* ==========================================================================
   Parks Grid
   ========================================================================== */

.parks-grid {
    padding: 3rem 0;
    min-height: 60vh;
}

.park-card-wrapper {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.park-card-wrapper.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.park-card {
    background: white !important; /* Force white background regardless of parent */
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.park-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Park Image */
.park-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.park-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.park-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.park-status.excellent {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.park-status.good {
    background: rgba(32, 201, 151, 0.9);
    color: white;
}

.park-status.fair {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

.park-status.poor {
    background: rgba(253, 126, 20, 0.9);
    color: white;
}

/* Park Content */
.park-content {
    padding: 1.5rem 1.5rem 2.5rem 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    color: #333333; /* Ensure text is dark for better contrast on white */
}

.park-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.park-title a {
    color: #2d3436;
    text-decoration: none;
    transition: color 0.2s ease;
}

.park-title a:hover {
    color: #9F4634;
}

.park-location {
    color: #333333;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.park-location i {
    margin-right: 0.5rem;
    color: #9F4634;
}

.park-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #333333;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3436;
    line-height: 1;
}

.park-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

/* Wildlife Tags */
.park-wildlife {
    margin-bottom: 1rem;
}

.wildlife-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wildlife-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.wildlife-tag {
    background: rgba(40, 167, 69, 0.1);
    color: #9F4634;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(40, 167, 69, 0.2);
    transition: all 0.2s ease;
}

.wildlife-tag:hover {
    background: rgba(40, 167, 69, 0.2);
    transform: scale(1.05);
}

/* Quick Facts */
.park-quick-facts {
    margin-bottom: 1.5rem;
}

.quick-fact {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #495057;
}

.quick-fact i {
    color: #9F4634;
    margin-right: 0.5rem;
    width: 16px;
    flex-shrink: 0;
}

/* Park Actions */
.park-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding: 12px 10px 10px 10px; /* Add padding on all sides */
}

.park-actions .btn {
    flex: 1;
    transition: all 0.2s ease;
    padding: 8px 16px;
    margin: 0 2px;
}

.park-actions .btn-primary {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: white; /* Ensure text is white for good contrast */
    margin: 0 5px; /* Additional margin for breathing space */
}

.park-actions .btn-outline-secondary {
    border-radius: 6px;
    padding: 8px 12px;
}

.btn-favorite {
    width: 44px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.btn-favorite.active {
    background-color: #d32f2f;
    border-color: #d32f2f;
    color: white;
}

.btn-favorite.active i::before {
    content: "\f5a5"; /* filled heart */
}

.park-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Loading and Empty States
   ========================================================================== */

#parksLoading,
#noResults {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

#clearFilters {
    transition: all 0.2s ease;
}

#clearFilters:hover {
    transform: translateY(-1px);
}

/* ==========================================================================
   Map Section
   ========================================================================== */

.parks-map {
    background: #f8f9fa;
    padding: 3rem 0;
    margin: 3rem 0;
}

.section-title {
    color: #2d3436;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Insights Section
   ========================================================================== */

.parks-insights {
    padding: 3rem 0;
}

.insights-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.insights-title {
    color: #2d3436;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.insight-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.insight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.insight-stat {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.insight-label {
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 0.5rem;
}

.insight-description {
    line-height: 1.4;
}

.insight-action {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* ==========================================================================
   Call to Action Section
   ========================================================================== */

.parks-cta {
    background: linear-gradient(135deg, #9F4634, #E94B35);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.cta-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-title {
    color: white;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-actions .btn {
    transition: all 0.2s ease;
}

.cta-actions .btn:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
    .hero-stats {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .filter-options {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .insights-panel {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .parks-hero {
        padding: 2rem 0;
    }
    
    .hero-stats {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .hero-stats .row {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .filter-controls {
        padding: 1rem;
    }
    
    .search-box {
        margin-bottom: 1rem;
    }
    
    .park-image {
        height: 200px;
    }
    
    .park-content {
        padding: 1rem;
        background-color: white;
    }
    
    .park-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .wildlife-tags {
        gap: 0.2rem;
    }
    
    .wildlife-tag {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .cta-actions {
        flex-direction: column;
    }
    
    .cta-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-stats .col-6 {
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .park-stats {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .park-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 10px 0 0 0;
    }
    
    .park-actions .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .btn-favorite {
        width: 38px;
        height: 38px;
    }
    
    .insights-panel {
        padding: 1.5rem;
    }
    
    .cta-content {
        padding: 1.5rem;
        text-align: center;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.park-card:focus-visible,
.park-title a:focus-visible,
.wildlife-tag:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .park-card {
        border: 2px solid #000;
    }
    
    .hero-stats,
    .filter-controls,
    .insights-panel,
    .cta-content {
        border: 1px solid #000;
    }
    
    .wildlife-tag {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .park-card,
    .park-image img,
    .wildlife-tag,
    .btn-favorite,
    .cta-actions .btn {
        transition: none;
    }
    
    .park-card:hover,
    .park-card:hover .park-image img,
    .wildlife-tag:hover,
    .cta-actions .btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .parks-hero,
    .parks-filters,
    .parks-cta {
        display: none;
    }
    
    .park-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    .park-actions {
        display: none;
    }
}