/* ========================================
   PREMIUM FEATURES - FULL IMPLEMENTATION
   Advanced Design System Activation
   ======================================== */

/* ========================================
   1. ANIMATED HERO GRADIENT
   ======================================== */
.header {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Particles im Header */
.header::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

/* ========================================
   2. GLASSMORPHISM CARDS
   ======================================== */
.scenario-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@supports (backdrop-filter: blur(10px)) {
    .scenario-card {
        background: rgba(255, 255, 255, 0.7);
    }
}

.section-card,
.result-card,
.form-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========================================
   3. GLOW EFFECTS ON HOVER
   ======================================== */
.scenario-card:hover {
    box-shadow:
        0 12px 32px rgba(102, 126, 234, 0.15),
        0 0 40px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover,
.btn-cta:hover {
    box-shadow:
        0 8px 24px rgba(102, 126, 234, 0.4),
        0 0 30px rgba(102, 126, 234, 0.3);
}

.scenario-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-card:hover .scenario-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(102, 126, 234, 0.3));
}

/* ========================================
   4. FLOATING LABEL INPUTS
   ======================================== */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-group input,
.form-group select {
    padding-top: 24px;
    padding-bottom: 8px;
}

.form-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    color: #757575;
    font-size: 16px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:valid + label {
    top: 12px;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

/* ========================================
   5. RIPPLE EFFECT ON BUTTONS
   ======================================== */
.btn-primary,
.btn-cta,
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-cta::after,
button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after,
.btn-cta:active::after,
button[type="submit"]:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   6. GRADIENT BORDER ON CARDS
   ======================================== */
.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scenario-card:hover::before {
    opacity: 1;
}

/* ========================================
   7. CIRCULAR PROGRESS INDICATOR
   ======================================== */
.circular-progress {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 20px auto;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.circular-progress .background {
    stroke: #e0e0e0;
}

.circular-progress .progress {
    stroke: url(#gradient);
    stroke-dasharray: 0 999;
    transition: stroke-dasharray 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress .percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

/* ========================================
   8. ANIMATED COUNTER
   ======================================== */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-number {
    animation: countUp 0.6s ease-out;
}

/* ========================================
   9. SUCCESS CELEBRATION (Confetti)
   ======================================== */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #667eea;
    animation: confetti-fall 3s linear forwards;
    z-index: 9999;
}

/* ========================================
   10. SKELETON SHIMMER (Enhanced)
   ======================================== */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   11. TOAST NOTIFICATIONS (Enhanced)
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 300px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.warning {
    border-left: 4px solid #ff9800;
}

.toast.info {
    border-left: 4px solid #2196f3;
}

/* ========================================
   12. DARK MODE SUPPORT
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2a2a2a;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #404040;
    }

    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }

    .scenario-card,
    .section-card,
    .form-container {
        background: rgba(42, 42, 42, 0.9);
        border-color: var(--border-color);
    }

    input,
    select,
    textarea {
        background: var(--bg-secondary);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    .header {
        background: linear-gradient(-45deg, #1e3a8a, #581c87, #6b21a8, #1e40af);
        background-size: 400% 400%;
        animation: gradientShift 15s ease infinite;
    }
}

/* ========================================
   13. IMPROVED FOCUS STATES (Accessibility)
   ======================================== */
*:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible {
    outline-offset: 4px;
}

/* ========================================
   14. LOADING OVERLAY
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   15. MICRO-INTERACTIONS
   ======================================== */

/* Bounce on click */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

.bounce-on-click:active {
    animation: bounce 0.3s ease;
}

/* Pulse effect */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Shake on error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ========================================
   16. BADGE & TOOLTIPS
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #2a2a2a;
    color: white;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* ========================================
   17. IMPROVED CARD GRID
   ======================================== */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px 0;
}

@media (max-width: 768px) {
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   18. ENHANCED RESULT DISPLAY
   ======================================== */
.result-card {
    border-left: 4px solid transparent;
    transition: border-color 0.3s ease;
}

.result-card.success {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), transparent);
}

.result-card.warning {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05), transparent);
}

.result-card.error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.05), transparent);
}

/* ========================================
   19. SMOOTH SCROLL BEHAVIOR
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   20. PRINT STYLES
   ======================================== */
@media print {
    .header,
    .back-link,
    button,
    .toast,
    .loading-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .scenario-card,
    .section-card,
    .result-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   21. REDUCED MOTION SUPPORT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
