/* ===== MASCOTE LOADER CSS ===== */
/* Este arquivo pode ser usado em qualquer projeto */

.mascote-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.mascote-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.mascote-loader.compact {
    position: relative;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loader-container {
    position: relative;
    text-align: center;
    animation: containerFloat 3s ease-in-out infinite;
}

.mascote-image {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    perspective: 1000px;
}

.mascote-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: mascoteWobble3D 5s ease-in-out infinite;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

/* Variações de rotação 3D removidas - mantendo apenas Wobble 3D como padrão */
.compact .mascote-image img {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
}

.compact .loader-container {
    margin-bottom: 0;
}

/* Partículas flutuantes */
.particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.compact .particles {
    width: 100px;
    height: 100px;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.compact .particle {
    width: 4px;
    height: 4px;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.particle:nth-child(2) {
    top: 20%;
    right: 20%;
    animation-delay: 0.5s;
    animation-duration: 3.5s;
}

.particle:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 1s;
    animation-duration: 2.5s;
}

.particle:nth-child(4) {
    bottom: 20%;
    right: 20%;
    animation-delay: 1.5s;
    animation-duration: 4s;
}

.particle:nth-child(5) {
    top: 50%;
    left: 10%;
    animation-delay: 2s;
    animation-duration: 3.2s;
}

.particle:nth-child(6) {
    top: 50%;
    right: 10%;
    animation-delay: 2.5s;
    animation-duration: 2.8s;
}

/* Texto de carregamento */
.loading-text {
    color: white;
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: textPulse 2s ease-in-out infinite;
    margin-top: 20px;
}

.compact .loading-text {
    display: none;
}

/* Barra de progresso */
.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin: 15px auto;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressGlow 2s ease-in-out infinite;
}

/* ===== ANIMAÇÕES ===== */

@keyframes mascoteRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes mascotePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== ANIMAÇÕES ===== */

@keyframes mascoteWobble3D {
    0%, 100% {
        transform: rotateY(0deg) rotateX(0deg) scale(1);
    }
    10% {
        transform: rotateY(15deg) rotateX(10deg) scale(1.05);
    }
    20% {
        transform: rotateY(-10deg) rotateX(-8deg) scale(1.02);
    }
    30% {
        transform: rotateY(12deg) rotateX(15deg) scale(1.08);
    }
    40% {
        transform: rotateY(-8deg) rotateX(-12deg) scale(1.03);
    }
    50% {
        transform: rotateY(180deg) rotateX(0deg) scale(1.1);
    }
    60% {
        transform: rotateY(192deg) rotateX(12deg) scale(1.03);
    }
    70% {
        transform: rotateY(170deg) rotateX(-8deg) scale(1.08);
    }
    80% {
        transform: rotateY(188deg) rotateX(15deg) scale(1.02);
    }
    90% {
        transform: rotateY(345deg) rotateX(-10deg) scale(1.05);
    }
}

@keyframes containerFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-25px) rotate(270deg);
        opacity: 1;
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

/* ===== ESTILOS DA DEMO ===== */
.demo-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.demo-container h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.loader-demos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.demo-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.demo-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ffeaa7;
}

.controls {
    text-align: center;
    margin: 40px 0;
}

.controls button {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    color: white;
    padding: 12px 24px;
    margin: 0 10px 10px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.usage-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 40px;
}

.usage-info code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffeaa7;
}

.usage-info ol {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

/* Loader inline para botões */
.mascote-loader.inline {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    z-index: 1000;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.mascote-loader.inline .loader-container {
    animation: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.mascote-loader.inline .mascote-image {
    margin: 0;
    perspective: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascote-loader.inline .mascote-image img {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px;
    backdrop-filter: blur(3px);
    border-radius: 50%;
}

.mascote-loader.inline .particles {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mascote-loader.inline .particle {
    width: 2px;
    height: 2px;
}

.mascote-loader.inline .loading-text {
    display: none;
}

.mascote-loader.inline .progress-bar {
    display: none;
}

/* Contêiner para botões com loader inline */
.button-with-loader {
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

/* Garantir que o loader não quebre o layout */
.button-with-loader::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 0;
    visibility: hidden;
}

/* Responsividade */
@media (max-width: 768px) {
    .loader-demos {
        grid-template-columns: 1fr;
    }
    
    .controls button {
        display: block;
        width: 200px;
        margin: 10px auto;
    }
    
    .demo-container {
        padding: 10px;
    }
    
    .mascote-image img {
        width: 80px;
        height: 80px;
    }
}
