/**
 * Squizito Fan - Premium Loading Styles
 *
 * A complete loading system featuring:
 * - Full-page loading overlay with animated logo
 * - Skeleton placeholders for cards, stats, and lists
 * - Smooth fade-in transitions
 * - Pulse and shimmer animations
 *
 * Brand Colors:
 * - Primary: #b3f400 (lime green)
 * - Background: #0a0a0f (dark)
 * - Secondary background: #12121a
 * - Accent: #9d4edd (purple), #00ced1 (cyan)
 * - Gold: #ffd700
 */

:root {
    --loader-lime: #b3f400;
    --loader-lime-glow: rgba(179, 244, 0, 0.4);
    --loader-bg-primary: #0a0a0f;
    --loader-bg-secondary: #12121a;
    --loader-bg-tertiary: #1a1a24;
    --loader-purple: #9d4edd;
    --loader-cyan: #00ced1;
    --loader-gold: #ffd700;
    --loader-transition: 0.3s ease;
}

/* =====================================================
   FULL PAGE LOADER
   ===================================================== */

.squizito-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity var(--loader-transition);
}

.squizito-page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Logo Container */
.loader-logo-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
}

/* Animated Rings */
.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid transparent;
}

.loader-ring-1 {
    width: 140px;
    height: 140px;
    border-top-color: var(--loader-lime);
    border-right-color: var(--loader-lime);
    animation: spin-ring 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    filter: drop-shadow(0 0 10px var(--loader-lime-glow));
}

.loader-ring-2 {
    width: 110px;
    height: 110px;
    border-bottom-color: var(--loader-purple);
    border-left-color: var(--loader-purple);
    animation: spin-ring 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
    filter: drop-shadow(0 0 8px rgba(157, 78, 221, 0.3));
}

.loader-ring-3 {
    width: 80px;
    height: 80px;
    border-top-color: var(--loader-cyan);
    border-right-color: var(--loader-cyan);
    animation: spin-ring 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    filter: drop-shadow(0 0 6px rgba(0, 206, 209, 0.3));
}

/* Center Logo/Icon */
.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    animation: pulse-logo 2s ease-in-out infinite;
}

/* Loading Text */
.loader-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--loader-lime);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: pulse-text 2s ease-in-out infinite;
}

.loader-subtext {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Loading Dots Animation */
.loader-dots {
    display: inline-block;
    width: 4px;
}

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

/* =====================================================
   SKELETON LOADERS
   ===================================================== */

.skeleton-container {
    opacity: 1;
    transition: opacity var(--loader-transition);
}

.skeleton-container.fade-out {
    opacity: 0;
}

.skeleton-container.hidden {
    display: none;
}

/* Base Skeleton Element */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--loader-bg-secondary) 0%,
        var(--loader-bg-tertiary) 50%,
        var(--loader-bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(179, 244, 0, 0.08) 50%,
        transparent 100%
    );
    animation: shimmer-sweep 2s ease-in-out infinite;
}

/* Skeleton Variants */
.skeleton-header {
    height: 200px;
    margin-bottom: 1.5rem;
    border-radius: 16px;
}

.skeleton-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

.skeleton-title {
    height: 32px;
    width: 60%;
    margin: 0 auto 0.5rem;
}

.skeleton-subtitle {
    height: 20px;
    width: 40%;
    margin: 0 auto;
}

.skeleton-card {
    background: var(--loader-bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-stat {
    height: 80px;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 0.75rem;
}

.skeleton-text-short {
    height: 16px;
    width: 60%;
}

.skeleton-text-medium {
    height: 16px;
    width: 80%;
}

.skeleton-text-long {
    height: 16px;
    width: 100%;
}

.skeleton-badge {
    height: 100px;
    margin-bottom: 1rem;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--loader-bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-icon-square {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
}

/* Grid Layouts */
.skeleton-grid {
    display: grid;
    gap: 1rem;
}

.skeleton-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.skeleton-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.skeleton-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Stats Grid */
.skeleton-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skeleton-stat-card {
    background: var(--loader-bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.skeleton-stat-value {
    height: 36px;
    width: 80px;
    margin: 0 auto 0.5rem;
}

.skeleton-stat-label {
    height: 16px;
    width: 100px;
    margin: 0 auto;
}

/* =====================================================
   CONTENT REVEAL ANIMATIONS
   ===================================================== */

.content-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.content-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animation */
.stagger-reveal > * {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-reveal.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-reveal.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-reveal.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-reveal.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-reveal.active > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-reveal.active > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-reveal.active > * {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes spin-ring {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes pulse-logo {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 20px var(--loader-lime-glow));
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        filter: drop-shadow(0 0 30px var(--loader-lime-glow));
    }
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px var(--loader-lime-glow);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 20px var(--loader-lime-glow);
    }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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

@keyframes shimmer-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .loader-logo-container {
        width: 120px;
        height: 120px;
    }

    .loader-ring-1 {
        width: 110px;
        height: 110px;
    }

    .loader-ring-2 {
        width: 85px;
        height: 85px;
    }

    .loader-ring-3 {
        width: 60px;
        height: 60px;
    }

    .loader-logo {
        font-size: 2.5rem;
    }

    .loader-text {
        font-size: 1rem;
    }

    .skeleton-grid-2,
    .skeleton-grid-3,
    .skeleton-grid-4 {
        grid-template-columns: 1fr;
    }

    .skeleton-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .skeleton-header {
        height: 150px;
    }

    .skeleton-avatar {
        width: 80px;
        height: 80px;
    }

    .skeleton-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

/* Prevent content flash */
.prevent-flash {
    opacity: 0;
}

.prevent-flash.loaded {
    opacity: 1;
    transition: opacity 0.4s ease;
}
