/* Custom styles for MyTimeCost */

:root {
  --bg-primary: theme('colors.slate.50');
  --bg-secondary: theme('colors.blue.50');
  --bg-tertiary: theme('colors.indigo.100');
  --text-primary: theme('colors.gray.900');
  --text-secondary: theme('colors.gray.600');
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] {
  --bg-primary: theme('colors.gray.900');
  --bg-secondary: theme('colors.gray.800');
  --bg-tertiary: theme('colors.gray.700');
  --text-primary: theme('colors.white');
  --text-secondary: theme('colors.gray.300');
  --glass-bg: rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.1);
}

.animated-gradient {
  background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #3b82f6);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}

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

.glow-effect:focus, .glow-effect:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  transition: box-shadow 0.3s ease;
}

.number-animate {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Enhanced Progress Bar Styling with Gradients */
.salary-progress-mud {
    height: 18px !important;
    border-radius: 12px !important;
    background: rgba(55, 65, 81, 0.8) !important;
    overflow: hidden;
    position: relative;
    transition: all 300ms ease-out;
}

.salary-progress-mud .mud-progress-linear {
    border-radius: 12px !important;
    transition: all 800ms ease-out;
}

/* Gradient Progress Bar Colors Based on Percentage */
.salary-progress-mud.progress-low .mud-progress-linear-bar {
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%) !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.salary-progress-mud.progress-medium .mud-progress-linear-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #eab308 100%) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.salary-progress-mud.progress-high .mud-progress-linear-bar {
    background: linear-gradient(90deg, #eab308 0%, #f97316 100%) !important;
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.5);
}

.salary-progress-mud.progress-extreme .mud-progress-linear-bar {
    background: linear-gradient(90deg, #f97316 0%, #ef4444 100%) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: extreme-pulse 2s ease-in-out infinite;
}

/* Dynamic Glow Effects */
.salary-progress-mud.progress-low {
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.2);
}

.salary-progress-mud.progress-medium {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.salary-progress-mud.progress-high {
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.4);
}

.salary-progress-mud.progress-extreme {
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
}

/* Pulsing Animation for Extreme Values */
@keyframes extreme-pulse {
    0%, 100% { 
        transform: scaleY(1); 
        filter: brightness(1); 
    }
    50% { 
        transform: scaleY(1.05); 
        filter: brightness(1.2); 
    }
}

/* Screen Shake Effect */
@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px) translateY(-1px); }
    20% { transform: translateX(2px) translateY(1px); }
    30% { transform: translateX(-1px) translateY(-2px); }
    40% { transform: translateX(1px) translateY(2px); }
    50% { transform: translateX(-2px) translateY(1px); }
    60% { transform: translateX(2px) translateY(-1px); }
    70% { transform: translateX(-1px) translateY(2px); }
    80% { transform: translateX(1px) translateY(-2px); }
    90% { transform: translateX(-2px) translateY(-1px); }
}

.screen-shake {
    animation: screen-shake 300ms ease-in-out;
}

/* Smooth Number Animation */
.percentage-counter {
    transition: all 800ms ease-out;
    display: inline-block;
}

/* Enhanced Container Effects */
.progress-container {
    transition: all 300ms ease-out;
}

.progress-container.high-impact {
    backdrop-filter: blur(12px);
    border-color: rgba(249, 115, 22, 0.3);
}

.progress-container.extreme-impact {
    backdrop-filter: blur(16px);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

/* Yahtzee Icon - iOS Safari Compatible */
.yahtzee-icon {
    position: relative;
    overflow: hidden;
    /* iOS Safari-friendly gradient animation using background-size */
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 50%, #06B6D4 100%);
    background-size: 200% 200%;
    /* Force hardware acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: background-position, box-shadow;
    /* Simple transform-only animation for iOS Safari */
    animation: iconGlow 3s ease-in-out infinite;
    -webkit-animation: iconGlow 3s ease-in-out infinite;
}

/* iOS Safari-friendly animation using only transforms and box-shadow */
@keyframes iconGlow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
        transform: translate3d(0, 0, 0) scale(1);
    }
    25% { 
        background-position: 25% 25%;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
        transform: translate3d(0, 0, 0) scale(1.02);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
        transform: translate3d(0, 0, 0) scale(1.05);
    }
    75% { 
        background-position: 75% 75%;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
        transform: translate3d(0, 0, 0) scale(1.02);
    }
}

@-webkit-keyframes iconGlow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
        -webkit-transform: translate3d(0, 0, 0) scale(1);
    }
    25% { 
        background-position: 25% 25%;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
        -webkit-transform: translate3d(0, 0, 0) scale(1.02);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
        -webkit-transform: translate3d(0, 0, 0) scale(1.05);
    }
    75% { 
        background-position: 75% 75%;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
        -webkit-transform: translate3d(0, 0, 0) scale(1.02);
    }
}

/* Simple shimmer overlay for iOS Safari */
.yahtzee-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 70%
    );
    background-size: 200% 200%;
    border-radius: inherit;
    opacity: 0;
    animation: shimmerSweep 4s ease-in-out infinite;
    -webkit-animation: shimmerSweep 4s ease-in-out infinite;
    will-change: opacity, background-position;
}

@keyframes shimmerSweep {
    0%, 90% { 
        opacity: 0; 
        background-position: -100% -100%;
    }
    5%, 15% { 
        opacity: 1; 
        background-position: 100% 100%;
    }
}

@-webkit-keyframes shimmerSweep {
    0%, 90% { 
        opacity: 0; 
        background-position: -100% -100%;
    }
    5%, 15% { 
        opacity: 1; 
        background-position: 100% 100%;
    }
}

/* Accessibility: Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .salary-progress-mud,
    .salary-progress-mud .mud-progress-linear,
    .percentage-counter,
    .progress-container {
        animation: none !important;
        transition: none !important;
    }
    
    .screen-shake {
        animation: none !important;
    }
    
    .salary-progress-mud.progress-extreme .mud-progress-linear-bar {
        animation: none !important;
    }
    
    .yahtzee-icon {
        animation: none !important;
        -webkit-animation: none !important;
        transform: translate3d(0, 0, 0) scale(1) !important;
        -webkit-transform: translate3d(0, 0, 0) scale(1) !important;
        background-position: 0% 50% !important;
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.4) !important;
    }
    
    .yahtzee-icon::before {
        animation: none !important;
        -webkit-animation: none !important;
        opacity: 0 !important;
    }
}


/* Yahtzee Score Quality Gradient System */
.score-excellent {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.score-very-good {
    background: rgba(34, 197, 94, 0.2) !important;
    border: 1px solid rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.15);
}

.score-good {
    background: rgba(132, 204, 22, 0.15) !important;
    border: 1px solid rgba(132, 204, 22, 0.2);
}

.score-average {
    background: transparent !important;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.score-below-average {
    background: rgba(251, 146, 60, 0.15) !important;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.score-poor {
    background: rgba(248, 113, 113, 0.2) !important;
    border: 1px solid rgba(248, 113, 113, 0.25);
    box-shadow: 0 0 6px rgba(248, 113, 113, 0.15);
}

.score-very-poor {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Enhanced Current Player Column Highlighting */
.current-player-pulse {
    animation: current-player-glow 2s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

.current-player-pulse::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.1));
    border-radius: 4px;
    z-index: -1;
    animation: current-player-shimmer 3s ease-in-out infinite;
}

@keyframes current-player-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
        transform: scale(1.01);
    }
}

@keyframes current-player-shimmer {
    0%, 100% {
        opacity: 0.5;
        background-position: 0% 50%;
    }
    50% {
        opacity: 0.8;
        background-position: 100% 50%;
    }
}

/* Dark mode support for score quality */
[data-theme="dark"] .score-excellent {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .score-very-good {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.18);
}

[data-theme="dark"] .score-good {
    background: rgba(132, 204, 22, 0.1) !important;
    border-color: rgba(132, 204, 22, 0.15);
}

[data-theme="dark"] .score-below-average {
    background: rgba(251, 146, 60, 0.1) !important;
    border-color: rgba(251, 146, 60, 0.15);
}

[data-theme="dark"] .score-poor {
    background: rgba(248, 113, 113, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.18);
}

[data-theme="dark"] .score-very-poor {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Accessibility: Reduce motion for score highlighting */
@media (prefers-reduced-motion: reduce) {
    .current-player-pulse {
        animation: none !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6) !important;
    }
    
    .current-player-pulse::before {
        animation: none !important;
        opacity: 0.3 !important;
    }
}

/* Completion Effects and Screen Shake Animations */
.completion-celebration {
    animation: completion-bounce 0.6s ease-out;
}

@keyframes completion-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.completion-flash {
    animation: flash-effect 0.3s ease-in-out;
}

@keyframes flash-effect {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(34, 197, 94, 0.2); }
}


/* Simplified layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: transparent;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }