/* Citadel Capital Inspired Loading Animations */

/* Global loading overlay */
.citadel-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.citadel-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Citadel Logo Loading Animation */
.citadel-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.citadel-logo-loader {
    position: relative;
    width: 80px;
    height: 80px;
}

.citadel-logo-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid var(--citadel-accent);
    border-radius: 50%;
    animation: citadel-spin 2s linear infinite;
}

.citadel-logo-loader::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 2px solid transparent;
    border-bottom: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: citadel-spin-reverse 1.5s linear infinite;
}

.citadel-logo-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--citadel-accent);
    border-radius: 4px;
    animation: citadel-pulse 2s ease-in-out infinite;
}

/* Loading text */
.citadel-loading-text {
    font-family: var(--citadel-font-primary);
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--citadel-white);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: citadel-fade-in-out 2s ease-in-out infinite;
}

.citadel-loading-dots::after {
    content: '';
    animation: citadel-dots 1.5s steps(4, end) infinite;
}

/* Minimal Spinner for Buttons */
.citadel-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: citadel-spin 1s linear infinite;
}

/* Card Loading Skeleton */
.citadel-skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: citadel-shimmer 2s ease-in-out infinite;
    border-radius: var(--citadel-radius-md);
}

.citadel-skeleton-line {
    height: 16px;
    margin-bottom: 8px;
}

.citadel-skeleton-line:last-child {
    width: 60%;
    margin-bottom: 0;
}

.citadel-skeleton-title {
    height: 24px;
    width: 80%;
    margin-bottom: 16px;
}

.citadel-skeleton-text {
    height: 14px;
    margin-bottom: 6px;
}

/* Progress Bar */
.citadel-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.citadel-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--citadel-accent), #f7d734);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.citadel-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: citadel-progress-shine 2s ease-in-out infinite;
}

/* Floating Elements */
.citadel-floating-element {
    position: absolute;
    pointer-events: none;
    opacity: 0.1;
}

.citadel-floating-element::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--citadel-accent);
    border-radius: 50%;
    animation: citadel-float 6s ease-in-out infinite;
}

.citadel-floating-element:nth-child(2)::before {
    animation-delay: -2s;
    animation-duration: 8s;
}

.citadel-floating-element:nth-child(3)::before {
    animation-delay: -4s;
    animation-duration: 7s;
}

/* Page Transition */
.citadel-page-transition {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--citadel-accent) 0%, #f7d734 100%);
    z-index: 9998;
    transition: left 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.citadel-page-transition.active {
    left: 0;
}

.citadel-page-transition.exit {
    left: 100%;
}

/* Hover Loading State */
.citadel-hover-loading {
    position: relative;
    overflow: hidden;
}

.citadel-hover-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(212, 175, 55, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
}

.citadel-hover-loading:hover::before {
    left: 100%;
}

/* Data Loading States */
.citadel-data-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--citadel-text-light);
}

.citadel-data-spinner {
    width: 32px;
    height: 32px;
    margin-right: 1rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--citadel-accent);
    border-radius: 50%;
    animation: citadel-spin 1s linear infinite;
}

/* Keyframe Animations */
@keyframes citadel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

@keyframes citadel-fade-in-out {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes citadel-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

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

@keyframes citadel-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes citadel-float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .citadel-logo-loader {
        width: 60px;
        height: 60px;
    }
    
    .citadel-loading-text {
        font-size: 0.9rem;
    }
}