/**
 * Tenant Skeleton Loaders
 * Skeletons para evitar FOUC (Flash of Unstyled Content)
 * durante carregamento das customizações do tenant
 */

/* ========================================
   BASE SKELETON STYLES
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    animation: skeleton-shine 1.5s ease-in-out infinite;
}

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

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

/* ========================================
   SPECIFIC SKELETON TYPES
   ======================================== */

/* Logo Skeleton */
.skeleton-logo {
    width: 150px;
    height: 50px;
    border-radius: 8px;
}

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

/* Texto curto (títulos, labels) */
.skeleton-text {
    height: 20px;
    width: 100%;
    max-width: 300px;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 16px;
    max-width: 200px;
}

.skeleton-text-lg {
    height: 28px;
    max-width: 400px;
}

/* Parágrafo / Texto longo */
.skeleton-paragraph {
    height: 16px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-paragraph:last-child {
    width: 70%;
}

/* Heading / Título de seção */
.skeleton-heading {
    height: 32px;
    width: 60%;
    max-width: 500px;
    margin-bottom: 16px;
    border-radius: 6px;
}

/* Avatar / Foto do corretor */
.skeleton-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

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

/* Botão */
.skeleton-button {
    height: 48px;
    width: 200px;
    border-radius: 8px;
}

/* Ícone social */
.skeleton-social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Hero Image */
.skeleton-hero {
    width: 100%;
    height: 500px;
    border-radius: 0;
}

@media (max-width: 768px) {
    .skeleton-hero {
        height: 300px;
    }
}

/* ========================================
   CONTAINER HELPERS
   ======================================== */

.skeleton-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ========================================
   FADE OUT ANIMATION (quando dados carregam)
   ======================================== */

.skeleton-fade-out {
    animation: skeleton-fadeout 0.3s ease-out forwards;
}

@keyframes skeleton-fadeout {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(
            90deg,
            #2a2a2a 0%,
            #1a1a1a 20%,
            #2a2a2a 40%,
            #2a2a2a 100%
        );
    }
    
    .skeleton::after {
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent
        );
    }
}

/* ========================================
   SPECIFIC USE CASES
   ======================================== */

/* Skeleton para seção "Sobre o Corretor" */
.skeleton-broker-section {
    padding: 4rem 0;
}

.skeleton-broker-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .skeleton-broker-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Skeleton para informações de contato */
.skeleton-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-contact-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-contact-text {
    flex: 1;
}

/* Skeleton para seção "Sobre a Região" */
.skeleton-region-section {
    padding: 4rem 0;
    background: #f9f9f9;
}

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

/* Esconde elemento enquanto skeleton está visível */
.hidden-while-loading {
    display: none !important;
}

/* Mostra quando dados carregarem */
.show-when-loaded {
    opacity: 0;
    animation: skeleton-fadein 0.3s ease-out 0.2s forwards;
}

@keyframes skeleton-fadein {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

