/* MKMTT Donation Ticker Styles - Standalone CSS Module */

/* Donation Ticker Container */
.donation-ticker {
    background: var(--donation-primary);
    color: white;
    padding: 1rem 0;
    overflow: hidden;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.donation-ticker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        var(--donation-primary) 0%, 
        transparent 10%, 
        transparent 90%, 
        var(--donation-primary) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Ticker Content */
.ticker-content {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    position: relative;
    z-index: 2;
}

.ticker-content:hover {
    animation-play-state: paused;
}

/* Ticker Items */
.ticker-item {
    padding: 0 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.ticker-item .donor-name {
    color: white;
    font-weight: 700;
}

.ticker-item .donation-amount {
    color: var(--donation-yellow-accent);
    font-weight: 700;
    font-size: 1.05rem;
}

.ticker-item .donation-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.ticker-item .ticker-separator {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.ticker-item .ticker-message {
    color: white;
    font-style: italic;
    font-weight: 500;
}

.ticker-item.no-donations .ticker-message {
    color: rgba(255, 255, 255, 0.9);
}

.ticker-item.error .ticker-message {
    color: #ffcccb;
}

/* Ticker Animation */
@keyframes ticker-scroll {
    0% { 
        transform: translateX(100%); 
    }
    100% { 
        transform: translateX(-100%); 
    }
}

/* Progress Bar Integration */
.donation-progress {
    background: var(--donation-bg-white);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--donation-shadow-lg);
}

.donation-progress .progress {
    height: 25px;
    border-radius: 12px;
    background: var(--donation-bg-light);
    overflow: hidden;
    margin-bottom: 1rem;
}

.donation-progress .progress-bar {
    background: linear-gradient(90deg, var(--donation-primary), var(--donation-primary-light));
    border-radius: 12px;
    transition: width 0.6s ease;
    position: relative;
}

.donation-progress .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress Statistics */
.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.progress-stat {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.progress-stat .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--donation-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.progress-stat .label {
    font-size: 0.9rem;
    color: var(--donation-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.progress-stat .percentage {
    font-size: 2rem;
    font-weight: 700;
    color: var(--donation-primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Total Raised Display */
.total-raised {
    font-size: 2rem;
    font-weight: 700;
    color: var(--donation-primary);
    text-align: center;
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
}

.total-raised.number-updating {
    transition: all 0.1s ease;
    transform: scale(1.05);
}

/* Ticker Controls */
.ticker-controls {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    gap: 0.5rem;
}

.ticker-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticker-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.ticker-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticker-pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .donation-ticker {
        padding: 0.75rem 0;
        min-height: 50px;
    }
    
    .ticker-item {
        padding: 0 1rem;
        font-size: 0.85rem;
    }
    
    .ticker-item .donation-amount {
        font-size: 0.95rem;
    }
    
    .ticker-item .donation-date {
        font-size: 0.8rem;
    }
    
    .progress-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .progress-stat {
        min-width: auto;
    }
    
    .total-raised {
        font-size: 1.5rem;
    }
    
    .ticker-controls {
        right: 0.5rem;
    }
    
    .ticker-refresh-btn,
    .ticker-pause-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .donation-ticker {
        padding: 0.5rem 0;
        min-height: 45px;
    }
    
    .ticker-item {
        padding: 0 0.75rem;
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    .ticker-item .donation-amount {
        font-size: 0.9rem;
    }
    
    .ticker-item .donation-date {
        font-size: 0.75rem;
    }
    
    .progress-stat .amount {
        font-size: 1.25rem;
    }
    
    .progress-stat .percentage {
        font-size: 1.5rem;
    }
    
    .total-raised {
        font-size: 1.25rem;
    }
    
    .ticker-controls {
        display: none; /* Hide controls on very small screens */
    }
}

/* Animation States */
.ticker-content.paused {
    animation-play-state: paused;
}

.ticker-content.running {
    animation-play-state: running;
}

/* Loading State */
.donation-ticker.loading {
    opacity: 0.7;
}

.donation-ticker.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error State */
.donation-ticker.error {
    background: #dc3545;
}

.donation-ticker.error .ticker-content {
    animation: none;
}

/* Success State */
.donation-ticker.success {
    background: var(--donation-secondary);
}

/* Accessibility */
.donation-ticker:focus-within {
    outline: 2px solid white;
    outline-offset: 2px;
}

.ticker-refresh-btn:focus,
.ticker-pause-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .donation-ticker {
        background: #f8f9fa !important;
        color: #333 !important;
        border: 1px solid #ccc;
    }
    
    .ticker-content {
        animation: none !important;
    }
    
    .ticker-controls {
        display: none !important;
    }
    
    .ticker-item .donation-amount {
        color: #333 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .donation-ticker {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .ticker-item .donation-amount {
        color: #ffff00;
    }
    
    .ticker-refresh-btn,
    .ticker-pause-btn {
        border: 2px solid #fff;
        background: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ticker-content {
        animation: none;
    }
    
    .progress-bar {
        transition: none;
    }
    
    .progress-bar::after {
        animation: none;
    }
    
    .total-raised.number-updating {
        transition: none;
        transform: none;
    }
}
