/* Professional Live Fundraising Display - 2025 */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0f1b;
    --bg-secondary: #141b2d;
    --bg-card: #1e2a3e;
    --primary: #0b78a6;
    --primary-light: #0d8fc4;
    --success: #22c55e;
    --accent: #ffd700;
    --amount-highlight: #ffcc00;
    --pledge-border: #ff8c00;
    --payment-border: #22c55e;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Layout */
    --header-height: 74px;
    --footer-height: 40px;
    --left-panel-width: 260px;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Fixed Progress Header */
.progress-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(20, 27, 45, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding: 0.6rem 1.25rem;
}

.progress-container {
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.campaign-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-stats {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    white-space: nowrap;
}

.progress-current {
    color: var(--accent);
    font-size: 1.1rem;
}

.progress-separator {
    color: var(--text-muted);
}

.progress-target {
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar-container {
    position: relative;
}

.progress-bar {
    position: relative;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 9px;
    position: relative;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(11, 120, 166, 0.5);
}

.progress-fill.complete {
    background: linear-gradient(135deg, var(--success), #10b981);
}

.progress-shimmer {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 6s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
    pointer-events: none;
    will-change: transform;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
    height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    position: relative;
}

/* Fixed Left Panel - Totals */
.totals-panel {
    width: var(--left-panel-width);
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

/* Total Cards */
.total-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.total-card[data-filter] {
    cursor: pointer;
}

.total-card[data-filter]:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.total-card.is-filter-active {
    border-color: rgba(255, 255, 255, 0.28);
}

.paid-card.is-filter-active {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.45);
}

.pledged-card.is-filter-active {
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.45);
}

.grand-card.is-filter-active {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.4);
}

.total-card.flash {
    animation: cardFlash 0.5s ease-out;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.card-header i {
    font-size: 1rem;
}

.card-header h3,
.card-header .card-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

button.total-card {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    color: inherit;
    text-align: inherit;
}

.paid-card .card-header i {
    color: var(--success);
}

.pledged-card .card-header i {
    color: var(--primary-light);
}

.grand-card .card-header i {
    color: var(--accent);
}

.card-value {
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    line-height: 1;
}

.card-value .currency {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-indicator {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
    pointer-events: none;
}

.indicator-pulse {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.paid-card .indicator-pulse {
    background: var(--success);
}

.pledged-card .indicator-pulse {
    background: var(--primary-light);
}

.grand-card .indicator-pulse {
    background: var(--accent);
}

/* Live Info */
.live-info {
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.live-clock {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.live-clock i {
    color: var(--primary);
}

.live-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

/* Scrollable Right Panel - Contributions */
.contributions-panel {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contributions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1.25rem;
    scroll-behavior: smooth;
}

.contribution-more-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 0.35rem 1.25rem 0.7rem;
}

.contrib-load-more {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    background: rgba(11, 120, 166, 0.18);
    color: var(--text-secondary);
    border: 1px solid rgba(11, 120, 166, 0.55);
    border-radius: 999px;
    padding: 0.32rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.contrib-load-more:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--primary-light);
    background: rgba(11, 120, 166, 0.32);
}

.contrib-load-more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.contrib-load-more[hidden] {
    display: none;
}

/* Contribution Items */
.contribution-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s ease;
    position: relative;
}

.contribution-item.show {
    opacity: 1;
    transform: translateX(0);
}

.contribution-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.contribution-content {
    flex: 1;
    min-width: 0;
}

.contribution-text {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

/* Highlight amounts in golden color */
.contribution-text .amount {
    color: var(--amount-highlight);
    font-weight: 700;
    /* Removed text-shadow for better readability */
}

/* Anonymous donor name styling */
.contribution-text .anonymous-name {
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
}

.contribution-text .anonymous-name::before {
    content: "🔒 ";
    font-size: 0.8em;
    opacity: 0.7;
    margin-right: 2px;
}

/* Subtle privacy indicator animation */
.contribution-text .anonymous-name::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
    animation: privacy-pulse 3s ease-in-out infinite;
}

@keyframes privacy-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Border colors for different contribution types */
.contribution-item.pledge {
    border-left: 3px solid var(--pledge-border);
    box-shadow: none;
}

.contribution-item.payment {
    border-left: 3px solid var(--payment-border);
    box-shadow: none;
}

.contribution-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.contribution-time {
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--text-muted);
}

.contribution-date {
    display: none;
}

/* NEW badge temporarily disabled
.contribution-new {
    position: absolute;
    top: -8px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: bounce 0.5s ease-out;
}
*/

.loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-message i {
    font-size: 2rem;
}

/* Scroll Hint */
.scroll-hint {
    position: sticky;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(11, 120, 166, 0.4);
    z-index: 10;
    animation: bounceIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.scroll-hint:hover {
    background: var(--primary-light);
    transform: translateX(-50%) translateY(-2px);
}

.scroll-hint i {
    animation: bounce 1s ease-in-out infinite;
}

/* Professional News Ticker Footer */
.message-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    border-top: 1px solid rgba(255, 215, 0, 0.55);
    display: flex;
    align-items: center;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
}

/* News ticker container */
.footer-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    height: 100%;
    width: 100%;
    position: relative;
}

/* Breaking news style label */
.footer-content::before {
    content: '● LIVE UPDATE';
    background: var(--accent);
    color: #000;
    padding: 0 0.75rem;
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    position: absolute;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 2;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* Scrolling text container */
.ticker-content {
    display: flex;
    align-items: center;
    animation: newsTicker 20s linear infinite;
    padding-left: 110px; /* Space for LIVE UPDATE label */
    gap: 3rem;
    height: 100%;
}

.footer-content i {
    color: var(--accent);
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

#footerMessage {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.025em;
}

/* Professional news ticker animation */
@keyframes newsTicker {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Pause on hover for readability */
.message-footer:hover .ticker-content {
    animation-play-state: paused;
}

/* Clean appearance without glow effects */
.ticker-content {
    /* Removed glow effects for better readability */
}

/* Side fade effects for smooth appearance */
.message-footer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(270deg, #1a1a2e, transparent);
    pointer-events: none;
    z-index: 1;
}

/* Fullscreen toggle button */
.fullscreen-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: opacity 0.25s ease, transform 0.2s ease;
    opacity: 0.35;
}

.fullscreen-btn:hover { opacity: 1; transform: translateY(-1px); }
.fullscreen-btn.hidden { opacity: 0; pointer-events: none; }
.fullscreen-btn i { font-size: 1rem; }

@media (max-width: 768px) {
    .fullscreen-btn { padding: 6px 8px; font-size: 0.8rem; top: 8px; right: 8px; }
    .fullscreen-btn i { font-size: 0.9rem; }
}

/* Mobile Responsive Design Enhancements */
@media (max-width: 768px) {
    :root {
        --header-height: 74px;
        --footer-height: 34px;
        --left-panel-width: 100%;
    }
    
    /* Compact header for mobile */
    .progress-header {
        padding: 0.45rem 0.65rem;
    }
    
    .campaign-title {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 0.2rem;
        font-weight: 700;
    }
    
    .progress-info {
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        margin-bottom: 0.35rem;
        text-align: center;
    }
    
    .progress-stats {
        font-size: 0.85rem;
        justify-content: center;
    }
    
    .progress-current {
        font-size: 1rem;
    }
    
    /* Main content mobile layout */
    .main-content {
        flex-direction: column;
        height: calc(100vh - var(--header-height) - var(--footer-height));
    }
    
    /* Ultra-compact top panel for mobile only */
    .totals-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0.35rem;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        gap: 0.35rem;
        justify-content: space-between;
    }
    
    /* Compact mobile cards */
    .total-card {
        min-width: 0;
        padding: 0.35rem 0.4rem;
        text-align: center;
        flex: 1 1 0;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .card-header {
        gap: 0.3rem;
        margin-bottom: 0.15rem;
        text-align: center;
    }
    
    .card-header i {
        font-size: 0.8rem;
    }
    
    .card-header h3,
    .card-header .card-title {
        font-size: 0.58rem;
        line-height: 1.1;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }
    
    .card-value {
        font-size: 0.95rem;
        justify-content: center;
        line-height: 1;
    }
    
    .card-value .currency {
        font-size: 0.65rem;
    }
    
    .card-indicator {
        display: none;
    }
    
    /* Hide live info on mobile to save space */
    .live-info {
        display: none;
    }
    
    /* Maximized contributions panel */
    .contributions-panel {
        flex: 1;
        min-height: 0;
    }
    
    .contributions-list {
        padding: 0.5rem;
    }
    
    /* Compact mobile contribution items */
    .contribution-item {
        padding: 0.5rem 0.6rem;
        gap: 0.5rem;
        margin-bottom: 0.4rem;
        border-radius: 8px;
    }
    
    .contribution-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .contribution-text {
        font-size: 0.85rem;
        line-height: 1.25;
        margin-bottom: 0.05rem;
    }
    
    .contribution-text .amount {
        font-size: 0.9rem;
        font-weight: 800;
    }
    
    .contribution-more-wrap {
        padding: 0.3rem 0.5rem 0.5rem;
    }

    .contrib-load-more {
        padding: 0.3rem 0.9rem;
        font-size: 0.68rem;
    }

    .contribution-time {
        font-size: 0.65rem;
        opacity: 0.85;
    }

    /* NEW badge temporarily disabled
    .contribution-new {
        top: -5px;
        right: 10px;
        padding: 0.15rem 0.5rem;
        font-size: 0.65rem;
    }
    */
    
    /* Compact mobile footer ticker */
    .footer-content::before {
        content: '●';
        padding: 0 0.5rem;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: auto;
    }
    
    .ticker-content {
        padding-left: 34px;
    }
    
    #footerMessage {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .footer-content i {
        font-size: 0.85rem;
        margin-right: 0.35rem;
    }
    
    /* Compact mobile progress bar */
    .progress-bar {
        height: 14px;
        border-radius: 7px;
    }
    
    .progress-fill {
        border-radius: 7px;
    }
    
    .progress-percentage {
        font-size: 0.65rem;
        right: 8px;
    }
    
    /* Compact loading message */
    .loading-message {
        padding: 1.5rem 0.75rem;
        font-size: 0.9rem;
        gap: 0.75rem;
    }
    
    .loading-message i {
        font-size: 1.25rem;
    }
    
    /* Compact scroll hint */
    .scroll-hint {
        bottom: 10px;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        border-radius: 20px;
    }
    
    /* Minimal announcement overlay */
    .announcement-overlay {
        margin: 1rem;
        padding: 0.75rem 1rem;
        max-width: calc(100vw - 2rem);
        min-height: auto;
        border-radius: 8px;
    }
    
    .announcement-content {
        flex-direction: row;
        text-align: left;
        gap: 0;
        align-items: center;
        justify-content: center;
    }
    
    .announcement-icon {
        display: none; /* Remove icon completely on mobile */
    }
    
    .announcement-text {
        font-size: 1rem;
        line-height: 1.3;
        text-align: center;
        margin: 0;
    }
    
    /* Compact effects */
    .celebration-text {
        font-size: 2rem;
        top: 20%;
        padding: 0 0.75rem;
        text-align: center;
    }
    
    /* Show more contributions by reducing gaps */
    .contributions-list::-webkit-scrollbar {
        width: 6px;
    }
    
    /* Optimize vertical space usage */
    body {
        font-size: 14px;
    }
    
    /* Ensure maximum content visibility */
    .main-content {
        overflow: hidden;
    }
}


/* Announcement Overlay */
.announcement-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, rgba(30, 42, 62, 0.98), rgba(20, 27, 45, 0.98));
    padding: 3rem 4rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 600px;
}

.announcement-overlay.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.announcement-icon {
    font-size: 3rem;
    color: var(--accent);
}

.announcement-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.announcement-overlay.milestone {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(20, 27, 45, 0.98));
    border-color: var(--accent);
}

/* Effects Container */
.effects-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
}

.celebration-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: celebrationBounce 2s ease-out;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    animation: confettiFall 3s linear forwards;
}

/* Scrollbar Styling */
.contributions-list::-webkit-scrollbar {
    width: 10px;
}

.contributions-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.contributions-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.contributions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes shimmer {
    0% { transform: translateX(0); }
    100% { transform: translateX(300%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes cardFlash {
    0% { background-color: var(--bg-card); }
    50% { background-color: rgba(255, 215, 0, 0.2); }
    100% { background-color: var(--bg-card); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes celebrationBounce {
    0% { transform: translateX(-50%) scale(0); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes bounceIn {
    0% { transform: translateX(-50%) scale(0.3); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 1200px) {
    :root {
        --left-panel-width: 216px;
    }

    .card-value {
        font-size: 1.2rem;
    }

    .campaign-title {
        font-size: 0.9rem;
    }
}

/* Very narrow phones: stack the card label under its icon */
@media (max-width: 400px) {
    .card-header {
        flex-direction: column;
        gap: 0.1rem;
    }

    .card-header h3,
    .card-header .card-title {
        font-size: 0.52rem;
    }

    .card-value {
        font-size: 0.85rem;
    }
}

/* Large displays: keep the feed readable from a distance */
@media (min-width: 1600px) {
    :root {
        --header-height: 86px;
        --footer-height: 46px;
        --left-panel-width: 300px;
    }

    .campaign-title {
        font-size: 1.2rem;
    }

    .progress-current {
        font-size: 1.35rem;
    }

    .progress-bar {
        height: 22px;
        border-radius: 11px;
    }

    .progress-fill {
        border-radius: 11px;
    }

    .card-value {
        font-size: 1.6rem;
    }

    #footerMessage,
    .footer-content i {
        font-size: 1.1rem;
    }

    .contribution-item {
        padding: 0.8rem 1.15rem;
        gap: 1rem;
        margin-bottom: 0.65rem;
    }

    .contribution-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .contribution-text {
        font-size: 1.25rem;
    }

    .contribution-time {
        font-size: 0.8rem;
    }

    .contrib-load-more {
        padding: 0.4rem 1.25rem;
        font-size: 0.8rem;
    }
}

/* Short viewports: trim rows so more of the feed stays visible */
@media (min-width: 769px) and (max-height: 720px) {
    .contributions-list {
        padding: 0.6rem 1rem;
    }

    .contribution-item {
        padding: 0.45rem 0.75rem;
        margin-bottom: 0.35rem;
    }

    .contribution-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .contribution-text {
        font-size: 0.9rem;
    }

    .contribution-time {
        font-size: 0.65rem;
    }

    .contribution-more-wrap {
        padding: 0.25rem 1rem 0.45rem;
    }

    .contrib-load-more {
        padding: 0.25rem 0.85rem;
        font-size: 0.66rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1a1a1a;
        --text-primary: #ffffff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
