/* Base Styles */
:root {
    --primary-color: #4a8fe7;
    --secondary-color: #3bc474;
    --accent-color: #f5a623;
    --dark-color: #2d3748;
    --light-color: #f8f9fa;
    --text-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

h1,
h2,
h3 {
    margin-bottom: 20px;
    line-height: 1.2;
}

p {
    margin-bottom: 15px;
}

/* Header Styles */
header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    text-align: center;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.donate-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.donate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Section Styles */
section {
    padding: 60px 0;
}

section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--dark-color);
}

/* About Section */
.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-cta {
    margin-top: 20px;
    text-align: center; /* Center the button */
}

.about-donate-btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.about-donate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background-color: #e09417;
}

.about-image {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    /* Limit maximum width */
    margin: 0 auto;
    /* Center if smaller than container */
}

.about-image img {
    width: 100%;
    max-height: 300px;
    /* Limit maximum height */
    object-fit: cover;
    /* Maintain aspect ratio while filling container */
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Progress Section */
.progress-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

#progress-map {
    flex: 2;
    min-width: 300px;
    height: 500px;
    /* Set fixed initial height */
    min-height: 280px;
    /* Ensure minimum height on all devices */
    background-color: #e9ecef;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    visibility: visible !important;
    /* Force visibility */
    display: block !important;
    /* Ensure display */
}

/* Add styles for Leaflet map */
.leaflet-container {
    height: 100% !important;
    width: 100% !important;
    border-radius: 8px;
    z-index: 1;
    /* Ensure proper stacking */
}

.current-position-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    background-color: var(--accent-color);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow);
    width: 30px !important;
    height: 30px !important;
    text-align: center;
    line-height: 30px;
    padding: 0;
    z-index: 1000;
    /* Make walker icon appear above the dots */
}

.current-position-marker i {
    font-size: 16px;
    margin: 0;
    padding: 0;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1px;
    /* Fine-tune vertical alignment */
    left: 0;
    /* Ensure no horizontal offset */
}

/* Enhanced popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 5px;
    padding: 1px;
    box-shadow: var(--shadow);
}

.leaflet-popup-content {
    margin: 10px 12px;
    line-height: 1.4;
}

.leaflet-popup-tip {
    box-shadow: var(--shadow);
}

.progress-stats {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-box {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-box h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stat-box p {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-box p+p {
    font-size: 1rem;
    color: #6c757d;
    margin-top: -5px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 0;
    transition: width 1s ease;
}

/* Donate Section */
.donate-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    margin-top: 20px;
}

.donate-text {
    flex: 1;
    min-width: 300px;
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.donate-button-container {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.justgiving-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #bd1f74;
    /* JustGiving pink */
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(189, 31, 116, 0.4);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.justgiving-btn:hover {
    background-color: #a51b67;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(189, 31, 116, 0.5);
}

.justgiving-btn i {
    font-size: 1.2em;
}

.fundraising-progress {
    margin-top: 20px;
}

#amount-raised {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 2s infinite;
}

/* Updates Section */
.updates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.update-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.update-card:hover {
    transform: translateY(-5px);
}

.update-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.update-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Walking Log */
.walking-log {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.walking-log-list {
    list-style: none;
    padding: 0;
}

.walking-log-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.walking-log-item:last-child {
    border-bottom: none;
}

.walking-date {
    font-weight: 600;
    color: var(--primary-color);
}

.walking-distance {
    color: var(--dark-color);
    font-weight: 700;
}

.walking-notes {
    flex-basis: 100%;
    margin-top: 8px;
    color: #6c757d;
    font-style: italic;
}

.loading-message {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

/* Walking Visualization Styles */
.walking-visualization {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.visualization-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.visualization-tab {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    transition: all 0.3s ease;
}

.visualization-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.visualization-content {
    min-height: 300px;
}

.chart-container {
    height: 400px;
    position: relative;
}

/* Walking stats styles */
.walking-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

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

.stat-sublabel {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 3px;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 30px 0;
    text-align: center;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--accent-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    section h2 {
        font-size: 1.8rem;
    }

    .about-content,
    .progress-container,
    .donate-content {
        flex-direction: column;
    }

    .about-image {
        max-width: 300px;
        /* Smaller on mobile */
    }

    footer .container {
        flex-direction: column;
    }

    .chart-container {
        height: 300px;
    }

    .walking-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .counter-amount {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .donate-btn,
    .justgiving-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .stat-box p {
        font-size: 1.5rem;
    }

    .about-image {
        max-width: 250px;
        /* Even smaller on very small screens */
    }

    .chart-container {
        height: 250px;
    }

    .counter-amount {
        font-size: 2.8rem;
    }

    .counter-goal {
        font-size: 1rem;
    }

    .counter-supporters {
        font-size: 0.9rem;
    }

    .money-counter {
        padding: 20px 15px;
    }
}

/* Ensure map is responsive */
@media (max-width: 992px) {
    #progress-map {
        height: 350px;
        width: 100% !important;
        /* Force full width */
        margin-bottom: 20px;
        /* Add space below map */
    }

    /* Force column layout on smaller screens */
    .progress-container {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    #progress-map {
        height: 280px;
        margin-bottom: 20px;
    }
}

/* Update info styles */
.update-info {
    text-align: center;
    margin-top: 30px;
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.last-updated {
    margin-bottom: 0;
}

.refresh-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-button:hover {
    background-color: #3a7cd0;
}

.refresh-button:disabled {
    background-color: #a0c0e8;
    cursor: not-allowed;
}

.refresh-button i {
    font-size: 0.9rem;
}

/* Supporter count styles */
#supporter-text {
    transition: opacity 0.3s ease;
}

#supporter-text.hidden {
    display: none;
}

#donor-count {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Enhanced Money Counter Styles */
.money-counter-wrapper {
    margin: 20px auto 40px;
    text-align: center;
}

.money-counter {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.money-counter:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.money-counter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.counter-amount {
    font-size: 4rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.counter-amount::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.counter-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.counter-goal {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.counter-supporters {
    margin-top: 12px;
    font-size: 1.1rem;
    color: #6c757d;
}

/* Enhanced progress bar */
.money-counter .progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0 auto 10px;
    max-width: 400px;
}

.money-counter .progress-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px rgba(75, 143, 231, 0.5);
    transition: width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Animation keyframes */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        opacity: 1;
    }
}

/* Animation for counter refresh */
@keyframes highlight-pulse {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 10px 30px rgba(59, 196, 116, 0.4);
    }

    100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
}

.highlight-pulse {
    animation: highlight-pulse 2s ease;
}

.counting {
    color: var(--secondary-color) !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    transition: color 0.3s ease;
}

/* Enhanced Walking Updates Styles */
.walking-updates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.update-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.update-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.update-date {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4381d6 100%);
    padding: 12px 15px;
    color: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.update-date::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
}

.update-day {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.update-date-display {
    font-size: 0.85rem;
    opacity: 0.9;
}

.update-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.update-distance {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.distance-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
}

.distance-unit {
    color: #6c757d;
    font-size: 1rem;
}

.update-progress {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.update-progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--secondary-color), #5edda0);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Responsive styles for walking updates */
@media (max-width: 992px) {
    .walking-updates {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .walking-updates {
        grid-template-columns: 1fr;
    }

    .distance-number {
        font-size: 1.8rem;
    }
}