/* Modern UI Enhancement Library for DojoDigit */

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(300px) rotateZ(720deg);
        opacity: 0;
    }
}

/* ===== Utility Classes ===== */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.5s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

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

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

/* ===== Glassmorphism Effects ===== */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Neumorphism Effects ===== */
.neumorphic {
    background: #e0e5ec;
    box-shadow: 9px 9px 16px #a3b1c6, -9px -9px 16px #ffffff;
}

.neumorphic-dark {
    background: #1a1a1a;
    box-shadow: 9px 9px 16px #0a0a0a, -9px -9px 16px #2a2a2a;
}

.neumorphic-inset {
    background: #e0e5ec;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
}

/* ===== Modern Card Styles ===== */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

.card-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ===== Gradient Backgrounds ===== */
.gradient-cosmic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-sunset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-ocean {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-forest {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-fire {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-mesh {
    background-color: #8EC5FC;
    background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);
}

/* ===== Interactive Elements ===== */
.interactive-scale {
    transition: transform 0.2s ease;
}

.interactive-scale:active {
    transform: scale(0.95);
}

.interactive-bounce {
    transition: transform 0.2s ease;
}

.interactive-bounce:active {
    transform: scale(0.95);
}

.interactive-bounce:hover {
    animation: pulse 0.5s ease;
}

/* ===== Skeleton Loaders ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.skeleton-dark {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===== Floating Labels ===== */
.floating-label {
    position: relative;
}

.floating-label input,
.floating-label textarea {
    padding-top: 1.5rem;
}

.floating-label label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    transition: all 0.2s ease;
    pointer-events: none;
    color: #6b7280;
}

.floating-label input:focus ~ label,
.floating-label input:not(:placeholder-shown) ~ label,
.floating-label textarea:focus ~ label,
.floating-label textarea:not(:placeholder-shown) ~ label {
    top: 0.25rem;
    font-size: 0.75rem;
    color: #3b82f6;
}

/* ===== Modern Tooltips ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* ===== Ripple Effect ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    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;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* ===== Modern Scrollbar ===== */
.modern-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modern-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modern-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

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

/* Dark mode scrollbar */
.dark .modern-scrollbar::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.dark .modern-scrollbar::-webkit-scrollbar-thumb {
    background: #555;
}

.dark .modern-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    position: relative;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner::before {
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

.spinner::after {
    border-bottom-color: #8b5cf6;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Morphing Buttons ===== */
.btn-morph {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-morph::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-morph:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== Particle Background ===== */
.particles {
    position: relative;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle-float 10s infinite linear;
}

@keyframes particle-float {
    from {
        transform: translateY(100vh) rotate(0deg);
    }
    to {
        transform: translateY(-100vh) rotate(360deg);
    }
}

/* ===== Success Animation ===== */
.success-checkmark {
    width: 80px;
    height: 80px;
    position: relative;
    display: inline-block;
}

.success-checkmark::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #10b981;
    animation: scaleIn 0.3s ease-out;
}

.success-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 40px;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

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

.error-shake {
    animation: shake 0.5s ease-in-out;
}

/* ===== Gradient Text ===== */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Modern Focus States ===== */
.modern-focus:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* ===== Smooth Transitions ===== */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}