/**
 * CONSTRUMETRIX - PREMIUM ANIMATIONS & UI ENHANCEMENTS
 * v2.0
 */

/* ==================== SKELETON LOADERS ==================== */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 200px;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text-sm {
    height: 10px;
    width: 60%;
}

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* ==================== CARD HOVER EFFECTS ==================== */
.item-card {
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(59, 96, 255, 0.1), 
        transparent
    );
    transition: left 0.5s ease;
}

.item-card:hover::before {
    left: 100%;
}

/* ==================== BUTTON ANIMATIONS ==================== */
button {
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after {
    width: 300px;
    height: 300px;
}

/* ==================== GLASS MORPHISM ENHANCED ==================== */
.glass-panel-enhanced {
    background: rgba(15, 15, 19, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ==================== PULSE GLOW ==================== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(59, 96, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 96, 255, 0.8);
    }
}

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

/* ==================== FLOATING ANIMATION ==================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ==================== NUMBER COUNTER ANIMATION ==================== */
@keyframes number-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.number-update {
    animation: number-pop 0.3s ease-out;
}

/* ==================== PROGRESS BAR ANIMATION ==================== */
@keyframes progress-indeterminate {
    0% {
        left: -35%;
        right: 100%;
    }
    60% {
        left: 100%;
        right: -90%;
    }
    100% {
        left: 100%;
        right: -90%;
    }
}

.progress-indeterminate::after {
    content: '';
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    animation: progress-indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

/* ==================== MODAL ANIMATIONS ==================== */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-backdrop {
    animation: modal-fade-in 0.3s ease-out;
}

.modal-content {
    animation: modal-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== TAB TRANSITIONS ==================== */
.tab-content-enter {
    animation: fadeInUp 0.4s ease-out forwards;
}

.tab-content-exit {
    animation: fadeInUp 0.3s ease-in reverse forwards;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

.toast-exit {
    animation: toast-slide-out 0.3s ease-in;
}

/* ==================== LOADING SPINNER ==================== */
@keyframes spinner-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid rgba(59, 96, 255, 0.1);
    border-top-color: #3b60ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spinner-rotate 0.8s linear infinite;
}

/* ==================== MICRO-INTERACTIONS ==================== */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ==================== FOCUS STATES ==================== */
*:focus-visible {
    outline: 2px solid #3b60ff;
    outline-offset: 2px;
    border-radius: 4px;
}

input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: #3b60ff;
    box-shadow: 0 0 0 3px rgba(59, 96, 255, 0.1);
}

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
    background: linear-gradient(135deg, #3b60ff 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== BADGE PULSE ==================== */
@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* ==================== RESPONSIVE IMPROVEMENTS ==================== */
@media (max-width: 768px) {
    .item-card {
        animation-duration: 0.3s;
    }
    
    button::after {
        display: none; /* Disable ripple on mobile for performance */
    }
}

/* ==================== DARK MODE ENHANCEMENTS ==================== */
@media (prefers-color-scheme: dark) {
    .glass-panel-enhanced {
        background: rgba(5, 5, 7, 0.7);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
}
