@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&display=swap');

:root {
    --miditaji-teal: #115c68;
    --miditaji-red: #ec0042;
    --miditaji-dark: #115c68;
    --miditaji-white: #ffffff;
    --miditaji-gray: #333333;
    --miditaji-glass: rgba(255, 255, 255, 0.05);
    --miditaji-glass-border: rgba(255, 255, 255, 0.1);
}

.miditaji-section {
    background-color: var(--miditaji-dark);
    color: var(--miditaji-white);
    font-family: 'Montserrat', sans-serif;
    padding: 60px 20px;
    border-radius: 20px;
    margin: 20px 0;
}

.miditaji-container {
    max-width: 1000px;
    margin: 0 auto;
}

.miditaji-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.miditaji-main-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    color: var(--miditaji-white);
}

.miditaji-intro-wrap {
    width: 100vw;
    max-width: none;
    margin: 0 calc(50% - 50vw) 50px;
    padding: 0;
}

.miditaji-intro {
    text-align: center;
    max-width: none;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.miditaji-intro + .miditaji-intro {
    margin-top: 8px;
}

/* TIERS GRID */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
    align-items: stretch;
}

.tier-card {
    background: var(--miditaji-glass);
    border: 1px solid var(--miditaji-glass-border);
    border-radius: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden; /* Prevent text/button bleed outside rounded corners */
    min-width: 0;
    min-height: 560px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.tier-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.tier-header {
    /* More breathing room from card edges */
    padding: 34px 30px 16px;
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.tier-header p {
    font-size: 0.78rem;
    text-transform: uppercase;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.7);
}

.tier-header p strong {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 800;
    color: var(--miditaji-white);
}

.tier-header h3 {
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    font-weight: 800;
    margin: 8px 0 14px;
    line-height: 0.95;
    color: var(--miditaji-white);
}

.tier-benefits {
    list-style: disc;
    /* Balanced inner spacing on all sides */
    padding: 0 30px 28px 50px;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.28;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.tier-benefits li {
    margin-bottom: 14px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-benefits strong {
    display: block;
    font-size: 0.86rem;
    line-height: 1.15;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-benefit-sub {
    display: block;
    font-size: 0.76rem;
    line-height: 1.24;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tier-icon {
    position: absolute;
    bottom: 50px;
    right: -20px;
    width: 220px;
    height: 220px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.tier-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tier-footer-badge {
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    box-sizing: border-box;
    color: var(--miditaji-red);
    padding: 15px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* HIGHLIGHT TIERS */
.tier-card.highlight {
    border-color: rgba(0, 128, 128, 0.3);
}

/* FORM STYLES */
.miditaji-form {
    background: #ffffff;
    border: none;
    padding: 40px 60px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #115c68;
    box-sizing: border-box;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.miditaji-form .miditaji-title {
    color: #115c68;
    font-size: 1.9rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row input, .form-row select {
    flex: 1;
    box-sizing: border-box;
    width: 100%;
    background: #ffffff;
    border: 2px solid var(--miditaji-red);
    border-radius: 25px;
    padding: 15px 20px;
    color: #115c68;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-row select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23115c68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
}

.form-row select:invalid {
    color: #9aa3ab;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row select option {
    color: #115c68;
    background: #ffffff;
}

.form-row input::placeholder {
    color: #9aa3ab;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row input:active,
.form-row select:active {
    outline: none;
    border-color: #115c68;
}

.form-checkbox {
    margin: 8px 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #115c68;
}

.amount-selection {
    margin: 6px 0 16px;
}

.amount-label {
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #115c68;
}

.amount-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.amount-btn {
    flex: 1;
    background: #ffffff;
    border: 2px solid var(--miditaji-red);
    color: #115c68;
    border-radius: 25px;
    padding: 15px;
    font-weight: 800;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
}

.amount-btn span {
    font-size: 1rem;
    font-weight: 800;
    color: #115c68;
}

.amount-btn.active, .amount-btn:hover {
    background: var(--miditaji-red);
    color: white;
}

.amount-btn.active span, .amount-btn:hover span {
    color: white;
}

.custom-amount {
    flex: 1;
    display: flex;
    min-width: 150px;
    position: relative;
}

.custom-amount input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid var(--miditaji-red);
    color: #115c68;
    padding: 12px 8px;
    border-radius: 25px;
    text-align: center;
    font-weight: 800;
    font-size: clamp(0.95rem, 2.1vw, 1.8rem);
    text-transform: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1;
}

.custom-amount input::-webkit-outer-spin-button,
.custom-amount input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-amount input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.custom-amount input::placeholder {
    color: #b0b0b0;
    font-weight: 800;
    font-size: clamp(0.72rem, 1.15vw, 0.95rem);
}

.custom-amount-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #b0b0b0;
    font-weight: 800;
    font-size: clamp(0.62rem, 0.95vw, 0.8rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-amount input:focus + .custom-amount-label,
.custom-amount input:not(:placeholder-shown) + .custom-amount-label {
    opacity: 0;
}

.custom-amount input:focus,
.custom-amount input:active {
    outline: none;
    border-color: #115c68;
}

@media (max-width: 900px) {
    .custom-amount input,
    .custom-amount input::placeholder {
        font-size: clamp(0.75rem, 2.8vw, 1.2rem);
        line-height: 1.15;
    }
    .custom-amount-label {
        font-size: clamp(0.58rem, 2vw, 0.72rem);
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .custom-amount input {
        font-size: clamp(0.92rem, 1.45vw, 1.2rem);
    }
    .custom-amount input::placeholder {
        font-size: clamp(0.68rem, 1.05vw, 0.88rem);
    }
}

.submit-btn {
    background: var(--miditaji-red);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
    flex: 1.5;
}

.submit-btn:hover {
    background: #ec0042;
    transform: scale(1.02);
}

.form-footer {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #115c68;
    margin-top: 20px;
    line-height: 1.4;
    text-transform: uppercase;
}

/* MAP STYLES */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    flex-wrap: wrap;
    gap: 15px;
}

/* New Header Progress Bar */
.top-progress-bar-wrapper {
    width: 100%;
    order: 3; /* Position below the text labels but within the flex container if needed, or separate */
    margin-top: 10px;
}

.top-progress-bar {
    position: relative;
    height: 38px;
    background: #1e252b; /* Dark background as in image */
    border: 3px solid #ec0042; /* Glowing red border */
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(236, 0, 66, 0.4);
    display: flex;
    align-items: center;
}

.top-progress-dashed {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    background-image: linear-gradient(to right, #666 50%, transparent 50%);
    background-size: 30px 4px; /* Dash size */
    z-index: 1;
}

.top-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #115c68 0%, #ec0042 100%); /* Teal to Red-Pink */
    width: 0%; /* Dynamic */
    z-index: 2;
    transition: width 0.5s ease-out;
    border-radius: 16px;
}

.top-progress-gear-container {
    position: absolute;
    top: 50%;
    left: 0%; /* Dynamic */
    transform: translate(-50%, -50%);
    z-index: 100;
    width: 48px;
    height: 48px;
    transition: left 0.5s ease-out;
}

.top-progress-gear-container img {
    width: 100%;
    height: 100%;
    animation: miditaji-spin 6s linear infinite;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

@keyframes miditaji-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.amount-accumulated {
    color: var(--miditaji-white);
    font-size: 1rem;
    font-weight: 800;
}

.amount-accumulated #current-goal-amount {
    font-size: 2rem;
    font-weight: 800;
}

.amount-accumulated .amount-unit {
    font-size: 1rem;
    font-weight: 800;
}

.goal-target {
    font-size: 2rem;
    font-weight: 800;
}

.goal-target .goal-number {
    font-size: 2rem;
    font-weight: 800;
}

.goal-target .goal-unit {
    font-size: 1rem;
    font-weight: 800;
}

.map-container {
    position: relative;
    background: #dddddd; 
    height: 736px;
    border-radius: 20px;
    border: 1px solid var(--miditaji-glass-border);
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
    z-index: 1;
    margin-top: 20px;
}


/* Grayscale filter for Leaflet tiles */
.leaflet-tile-pane {
    filter: grayscale(100%) brightness(0.95) contrast(1.1);
}

.map-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.map-background-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.map-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* The actual path drawn by donors */
.route-path {
    fill: none;
    stroke: var(--miditaji-red);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 1s ease-out;
}

/* The underlying grey path showing the total route */
.route-path-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.2);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gear-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%); /* Center the gear on the coordinate */
    transition: left 1s ease-out, top 1s ease-out;
    z-index: 1000;
}

.gear-indicator img {
    width: 100%;
    animation: rotateGear 5s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@keyframes rotateGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.km-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--miditaji-red);
    padding: 10px 40px;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(230, 25, 75, 0.4);
    z-index: 1000;
}

.km-counter p {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    color: white;
}

.km-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}

/* SUPPORTERS STYLES */
.supporters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.supporter-name {
    background: #ffffff;
    border: 1px solid #dbe3e7;
    padding: 20px;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    color: #115c68;
    transition: background 0.3s ease;
}

.supporter-name:hover {
    background: #f4f7f9;
}

/* Modal and Shirt Button */
.miditaji-btn-outline {
    background: #ffffff;
    border: 2px solid var(--miditaji-red);
    color: var(--miditaji-red);
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin-top: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}
.miditaji-btn-outline:hover {
    background: var(--miditaji-red);
    color: white;
}

.miditaji-section .tier-benefits .miditaji-btn-outline {
    display: inline-flex;
    align-items: center;   /* vertical centering */
    justify-content: center; /* horizontal centering */
    width: fit-content;
    min-width: 200px;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

/* Dedicated CTA row so button is centered and doesn't touch card edges */
.miditaji-section .tier-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    padding: 0 8px;
    box-sizing: border-box;
}

/* Strong override for Elementor/theme button defaults */
.miditaji-section .tier-cta .miditaji-btn-outline {
    align-self: center;
    text-align: center;
}

.miditaji-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}
.miditaji-modal-content {
    background-color: #fff;
    color: #115c68;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}
.miditaji-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #115c68;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
}
.shirt-designs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}
.shirt-img-placeholder {
    aspect-ratio: 1;
    background: #f4f6f7;
    border: 2px dashed #115c68;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #115c68;
    font-weight: 600;
}
@media (max-width: 600px) {
    .shirt-designs-grid {
        grid-template-columns: 1fr;
    }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .amount-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .submit-btn {
        grid-column: span 2;
    }
    .tiers-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .tier-card {
        min-height: 0;
    }
    .tier-header {
        padding: 28px 24px 14px;
    }
    .tier-benefits {
        padding: 0 24px 24px 42px;
    }
    .miditaji-section .tier-benefits .miditaji-btn-outline {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    .miditaji-title {
        font-size: 1.5rem;
    }
    .amount-buttons {
        grid-template-columns: 1fr 1fr;
    }
    .submit-btn {
        grid-column: span 2;
    }
    .tiers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .tier-header {
        padding: 24px 20px 12px;
    }
    .tier-benefits {
        padding: 0 20px 20px 36px;
    }
    .tier-benefits strong {
        font-size: 0.82rem;
    }
    .tier-benefit-sub {
        font-size: 0.72rem;
    }
}
