/**
 * Streak Indicator Component
 *
 * Visual styling for streak indicators with urgency-based color coding.
 * Used in navbar and profile pages to show streak status.
 */

/* Base streak indicator styling */
.streak-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Streak icon styling */
.streak-indicator .fas.fa-fire {
    font-size: 1.1em;
    transition: all 0.3s ease;
}

/* Safe state - Green (>6 hours remaining or completed today) */
.streak-safe .fas.fa-fire {
    color: #10b981;  /* Green */
}

.streak-safe:hover .fas.fa-fire {
    color: #059669;
    transform: scale(1.1);
}

/* Neutral state - Gray (no active streak) */
.streak-neutral .fas.fa-fire {
    color: var(--color-text-secondary);  /* Gray */
}

/* Warning state - Yellow/Orange (2-6 hours remaining) */
.streak-warning .fas.fa-fire {
    color: #f59e0b;  /* Amber */
    animation: pulse-warning 2s ease-in-out infinite;
}

.streak-warning:hover .fas.fa-fire {
    color: #d97706;
}

/* Urgent state - Orange/Red (<2 hours remaining) */
.streak-urgent .fas.fa-fire {
    color: #ef4444;  /* Red */
    animation: pulse-urgent 1.5s ease-in-out infinite;
}

.streak-urgent:hover .fas.fa-fire {
    color: #dc2626;
}

/* Critical state - Flashing Red (<30 minutes remaining) */
.streak-critical .fas.fa-fire {
    color: #dc2626;  /* Dark Red */
    animation: flash-critical 1s ease-in-out infinite;
}

.streak-critical:hover .fas.fa-fire {
    color: #991b1b;
}

/* Pulse animation for warning state */
@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Stronger pulse for urgent state */
@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Flash animation for critical state */
@keyframes flash-critical {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    25% {
        opacity: 0.5;
        transform: scale(1.15);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    75% {
        opacity: 0.5;
        transform: scale(1.15);
    }
}

/* Navbar-specific styling */
#navbar-streak-tooltip {
    cursor: pointer;
    user-select: none;
}

#navbar-streak-tooltip .fas.fa-fire {
    margin-right: 0.25rem;
}

/* Add background color variants for more prominent indicators */
.streak-indicator.with-background {
    padding: 0.375rem 0.875rem;
}

.streak-safe.with-background {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.streak-warning.with-background {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.streak-urgent.with-background {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.streak-critical.with-background {
    background-color: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .streak-indicator {
        font-size: 0.9rem;
    }

    .streak-indicator .fas.fa-fire {
        font-size: 1em;
    }
}

/* Tooltip enhancements for streak status */
.tooltip.streak-tooltip .tooltip-inner {
    max-width: 300px;
    text-align: left;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.tooltip.streak-tooltip.streak-safe .tooltip-inner {
    background-color: #10b981;
}

.tooltip.streak-tooltip.streak-warning .tooltip-inner {
    background-color: #f59e0b;
}

.tooltip.streak-tooltip.streak-urgent .tooltip-inner {
    background-color: #ef4444;
}

.tooltip.streak-tooltip.streak-critical .tooltip-inner {
    background-color: #dc2626;
}
