/**
 * Frost Warning System Styles
 * Animationen und Styles für die Frostwarnungs-Modals
 */

/* Animation für das Modal-Erscheinen */
@keyframes bounceOnce {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Shake Animation für kritische Warnung */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

/* Pulse Animation für Warning Icon */
@keyframes pulseFast {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Frost Crystal Animation */
@keyframes frostSparkle {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.3;
        transform: scale(1);
    }
}

/* Temperature Drop Animation */
@keyframes temperatureDrop {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }
    50% {
        transform: translateY(5px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
    }
}

/* Animation Classes */
.animate-bounce-once {
    animation: bounceOnce 0.6s ease-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-pulse-fast {
    animation: pulseFast 1.5s ease-in-out infinite;
}

.animate-frost-sparkle {
    animation: frostSparkle 2s ease-in-out infinite;
}

.animate-temperature-drop {
    animation: temperatureDrop 1s ease-out;
}

/* Frost Warning Modal Overlay */
#frost-warning-modal {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Warning Badge Animation */
.frost-warning-badge {
    position: relative;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
}

.frost-warning-badge::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-radius: 9999px;
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

/* Temperature Indicator */
.temperature-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 0.5rem;
    color: #1e40af;
    font-weight: bold;
}

.temperature-indicator.critical {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* Frost Icon Animation */
.frost-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233b82f6"><path d="M12 2L10.6 4.8L7.5 3L8.3 6.1L5 7L7.8 8.4L6 11.5L9.1 10.7L10 14L11.4 11.2L14.5 13L13.7 9.9L17 9L14.2 7.6L16 4.5L12.9 5.3L12 2Z"/></svg>');
    background-size: contain;
    animation: frostSparkle 2s ease-in-out infinite;
}

/* Warning Message Styles */
.frost-warning-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-left: 4px solid #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.frost-warning-message h3 {
    color: #991b1b;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.frost-warning-message ul {
    color: #7f1d1d;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.frost-warning-message li {
    margin: 0.5rem 0;
}

/* Weather Cards for Forecast */
.weather-forecast-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
    transition: all 0.3s ease;
}

.weather-forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.weather-forecast-card.critical {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid #dc2626;
}

.weather-forecast-card .date {
    font-weight: 600;
    color: #374151;
}

.weather-forecast-card .temperature {
    font-size: 1.25rem;
    font-weight: bold;
}

.weather-forecast-card .temperature.below-zero {
    color: #dc2626;
}

/* Frost Protection Checklist */
.frost-checklist {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.frost-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: #f9fafb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.frost-checklist-item:hover {
    background: #f3f4f6;
}

.frost-checklist-item .icon {
    color: #10b981;
    flex-shrink: 0;
}

.frost-checklist-item.urgent {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border: 1px solid #f59e0b;
}

.frost-checklist-item.urgent .icon {
    color: #f59e0b;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    #frost-warning-modal .bg-white,
    #frost-warning-modal .dark\:bg-gray-800 {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .weather-forecast-card {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .frost-checklist-item {
        padding: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .frost-warning-message {
        background: linear-gradient(135deg, #7f1d1d, #991b1b);
    }

    .weather-forecast-card {
        background: #374151;
        color: #f3f4f6;
    }

    .weather-forecast-card.critical {
        background: linear-gradient(135deg, #991b1b, #7f1d1d);
    }

    .frost-checklist {
        background: #1f2937;
    }

    .frost-checklist-item {
        background: #374151;
        color: #f3f4f6;
    }

    .frost-checklist-item.urgent {
        background: linear-gradient(135deg, #92400e, #78350f);
    }
}