/**
 * THKR Donation Thermometer Styles
 * Matches Two Hearts Kitten Rescue design system
 */

/* CSS Variables - THKR Brand Colors */
:root {
    --thkr-dark-teal: #0C4862;
    --thkr-coral: #FF9876;
    --thkr-coral-light: #FFB499;
    --thkr-peach: #EBCAC0;
    --thkr-light-peach: #FFE8E0;
    --thkr-lightest-peach: #FFF5F2;
}

/* Container */
.thkr-thermometer-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Title - high specificity to override theme */
.thkr-thermometer-container .thkr-thermometer-title,
.thkr-thermometer-container h3.thkr-thermometer-title,
h3.thkr-thermometer-title {
    font-size: 2rem !important;
    color: #0C4862 !important;
    margin-bottom: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    font-family: 'Fredoka', sans-serif !important;
}

/* Subtitle/Goal text */
.thkr-thermometer-goal {
    font-size: 1.2rem;
    color: var(--thkr-dark-teal);
    opacity: 0.85;
    margin-bottom: 2.25rem;
    line-height: 1.6;
}

/* Display wrapper for thermometer + markers */
.thkr-thermometer-display {
    position: relative;
    padding: 0 80px;
    display: inline-block;
}

/* Wrapper for thermometer tube + bulb */
.thkr-thermometer-wrapper {
    position: relative;
    display: inline-block;
}

/* Thermometer tube */
.thkr-thermometer {
    position: relative;
    width: 80px;
    height: 350px;
    margin: 0 auto;
    background: white;
    border: 4px solid var(--thkr-dark-teal);
    border-radius: 40px 40px 0 0;
    border-bottom: none;
    overflow: hidden;
}

/* Fill level with logo pattern */
.thkr-thermometer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--thkr-coral);
    background-image:
        url('../images/thkr-logo-pattern.png'),
        url('../images/thkr-logo-pattern.png');
    background-size: 54px 54px, 54px 54px;
    background-repeat: repeat;
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: thkr-logo-float 4s ease-in-out infinite;
}

@keyframes thkr-logo-float {
    0%, 100% {
        background-position: 0 0, 80px 27px;
    }
    50% {
        background-position: 0 -5px, 80px 22px;
    }
}

/* Bulb at bottom */
.thkr-thermometer-bulb {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--thkr-dark-teal);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -24px;
}

/* Bulb fill (always full) */
.thkr-thermometer-bulb-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--thkr-coral), var(--thkr-coral-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo icon in bulb (replaces heart) */
.thkr-logo-icon {
    width: 3.5rem;
    height: 3.5rem;
    z-index: 10;
    display: block;
    object-fit: contain;
    animation: thkr-logo-pulse 1.5s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes thkr-logo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

/* Legacy heart icon support */
.thkr-heart-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: white;
    z-index: 10;
    animation: thkr-logo-pulse 1.5s ease-in-out infinite;
}

/* Dollar markers on the side */
.thkr-thermometer-markers {
    position: absolute;
    left: 0;
    top: 0;
    height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 15px;
}

.thkr-thermometer-marker {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--thkr-dark-teal);
    text-align: right;
    white-space: nowrap;
}

/* Amount raised display */
.thkr-thermometer-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--thkr-coral);
    margin: 1rem 0 0.5rem;
}

/* "raised of X goal" label */
.thkr-thermometer-label {
    font-size: 1rem;
    color: var(--thkr-dark-teal);
    opacity: 0.8;
}

/* ================================
   Responsive Styles
   ================================ */

@media (max-width: 768px) {
    .thkr-thermometer-container {
        padding: 0;
        margin: 0 auto;
    }

    .thkr-thermometer-title {
        font-size: 1.8rem !important;
        margin-bottom: 0.25rem !important;
    }

    .thkr-thermometer-goal {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .thkr-thermometer-display {
        transform: scale(1);
        margin: 0;
    }

    .thkr-thermometer {
        width: 80px;
        height: 340px;
    }

    .thkr-thermometer-bulb {
        width: 100px;
        height: 100px;
    }

    .thkr-heart-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .thkr-logo-icon {
        width: 3.2rem;
        height: 3.2rem;
    }

    .thkr-thermometer-markers {
        height: 340px;
        font-size: 0.9rem;
    }

    .thkr-thermometer-marker {
        padding: 0;
    }

    .thkr-thermometer-amount {
        font-size: 2.2rem;
        margin-top: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .thkr-thermometer-label {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .thkr-thermometer-container {
        padding: 0;
        margin: 0 auto;
    }

    .thkr-thermometer-title {
        font-size: 1.6rem !important;
        margin-bottom: 0.15rem !important;
    }

    .thkr-thermometer-goal {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .thkr-thermometer-display {
        transform: scale(1);
        padding: 0 70px;
        margin: 0;
    }

    .thkr-thermometer {
        width: 75px;
        height: 320px;
    }

    .thkr-thermometer-bulb {
        width: 95px;
        height: 95px;
    }

    .thkr-heart-icon {
        width: 2.3rem;
        height: 2.3rem;
    }

    .thkr-logo-icon {
        width: 3rem;
        height: 3rem;
    }

    .thkr-thermometer-markers {
        height: 320px;
    }

    .thkr-thermometer-marker {
        font-size: 0.85rem;
    }

    .thkr-thermometer-amount {
        font-size: 2rem;
        margin-top: 0.25rem;
        margin-bottom: 0.15rem;
    }

    .thkr-thermometer-label {
        font-size: 0.9rem;
    }
}

/* ================================
   Pale Coral Theme
   ================================ */

/* Pale theme - mercury fill uses pale coral instead of rich coral */
.thkr-theme-pale .thkr-thermometer-fill {
    background-color: var(--thkr-light-peach);
    /* Uses colored logo pattern for pale theme */
    background-image:
        url('../images/thkr-logo-pattern-color.png'),
        url('../images/thkr-logo-pattern-color.png');
}

/* Pale theme - bulb uses pale coral with colored logo */
.thkr-theme-pale .thkr-thermometer-bulb-fill {
    background: linear-gradient(135deg, var(--thkr-light-peach), var(--thkr-lightest-peach));
}

/* Pale theme - amount text stays coral for contrast */
.thkr-theme-pale .thkr-thermometer-amount {
    color: var(--thkr-coral);
}

/* ================================
   Goal Reached State
   ================================ */

.thkr-thermometer-container.goal-reached .thkr-thermometer-fill {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    animation: thkr-celebration 0.5s ease-in-out;
}

.thkr-thermometer-container.goal-reached .thkr-thermometer-bulb-fill {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

@keyframes thkr-celebration {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}
