/* Dashboard Loading Animations CSS */

/* Loading Overlay */
#dashboard-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-container {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

/* Loading Logo Animation */
.loading-logo {
    position: relative;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    backdrop-filter: blur(10px);
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-circle i {
    font-size: 2rem;
    animation: logoRotate 2s linear infinite;
}

.loading-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Loading Text */
.loading-text h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: textGlow 2s ease-in-out infinite alternate;
}

.loading-text p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

/* Progress Bar */
.loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ecf0f1, #ffffff, #ecf0f1);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressShimmer 2s linear infinite;
}

/* Loading Steps */
.loading-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    transition: all 0.5s ease;
}

.step.active {
    opacity: 1;
    transform: scale(1.1);
}

.step i {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step.active i {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.step span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Content Animation Classes */
.content-section {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-in {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in-delayed {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.animate-in-stagger {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

/* Card Hover Effects */
.card, .bot-card, .energy-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card:hover, .bot-card:hover, .energy-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

/* Ripple Effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Chart Animation */
.chart-container {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-animate-in {
    animation: chartFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Page Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transition-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Keyframe Animations */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .loading-container {
        padding: 1rem;
        max-width: 300px;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-circle i {
        font-size: 1.5rem;
    }
    
    .loading-pulse {
        width: 90px;
        height: 90px;
    }
    
    .loading-text h3 {
        font-size: 1.5rem;
    }
    
    .loading-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .step {
        flex: 1;
        min-width: 80px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading States for Interactive Elements */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Skeleton Loading for Content */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Enhanced Focus States */
.btn:focus,
.form-control:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Performance Optimizations */
.hardware-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.gpu-optimized {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}