/* Custom animations and styles */

:root {
    --color-primary: #FF9F1C;
    --color-secondary: #2EC4B6;
    --color-background: #FDFFFC;
    --bg-pattern-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FF9F1C' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Page Transitions */
.page-enter {
    animation: fade-in-up 0.3s ease-out forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Background Pattern */
.bg-pattern {
    background-color: var(--color-background);
    background-image: var(--bg-pattern-image);
}

.dark .bg-pattern {
    background-color: #1f2937;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FF9F1C' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* Modern Range Slider */
.modern-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e5e7eb; /* Fallback */
    border-radius: 999px;
    outline: none;
    transition: opacity 0.2s;
    cursor: pointer;
}

.dark .modern-range {
    background: #374151;
}

.modern-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: -6px; /* Center thumb on track if track height < thumb height */
}

/* Firefox specific */
.modern-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover & Active States */
.modern-range:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.15);
}

.modern-range:active::-webkit-slider-thumb {
    transform: scale(1.2);
    background: var(--color-primary);
    box-shadow: 0 0 0 6px rgba(255, 159, 28, 0.25);
}

.modern-range:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.15);
}

.modern-range:active::-moz-range-thumb {
    transform: scale(1.2);
    background: var(--color-primary);
    box-shadow: 0 0 0 6px rgba(255, 159, 28, 0.25);
}

/* Track styling for Webkit (Chrome/Safari/Edge) needs to be handled via JS for the 'fill' effect usually, 
   but we can set a base style here. The JS will override 'background' with a linear-gradient. */
.modern-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    border-radius: 999px;
}

.modern-range::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    border-radius: 999px;
    background: transparent; /* JS handles background on the input itself */
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1f2937; /* gray-800 */
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

/* Animations */
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.animate-pulse-soft {
    animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Interactive Elements Polish */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-press {
    transition: transform 0.1s ease;
}

.btn-press:active {
    transform: scale(0.98);
}

.icon-spin-hover:hover {
    animation: spin 1s linear infinite;
}

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

/* Staggered List Animation */
@keyframes slide-in-up-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-animate > * {
    opacity: 0;
    animation: slide-in-up-fade 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.stagger-animate > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animate > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animate > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animate > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animate > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animate > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animate > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animate > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-animate > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-animate > *:nth-child(10) { animation-delay: 0.5s; }

/* Scroll Reveal Animation */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Modal Animations */
@keyframes modal-pop-in {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-animate-in {
    animation: modal-pop-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Animations */
@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast-animate-in {
    animation: toast-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Input Focus Ring Animation */
input:focus, select:focus, textarea:focus {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Shimmer Effect for Loading */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
}

.dark .shimmer {
    background: linear-gradient(to right, #1f2937 4%, #374151 25%, #1f2937 36%);
}

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

.animate-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
