/* ARQUIVO: global/loader.css */
:root {
    --af-primary: #53954a;   /* Verde Core */
    --af-secondary: #6e513d; /* Marrom Core */
}

/* OVERLAY QUE BLOQUEIA A TELA */
.af-loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(249, 239, 212, 0.92); /* Creme translúcido */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.af-loader-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* SPINNER "ALIMENTANDO FASES" */
.af-spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.af-ring {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--af-primary);
    animation: af-spin 1s linear infinite;
}

.af-ring-inner {
    position: absolute;
    top: 15px; left: 15px;
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-bottom-color: var(--af-secondary);
    animation: af-spin-reverse 1.5s linear infinite;
}

.af-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--af-primary);
    font-size: 1.2rem;
    animation: af-pulse 2s infinite;
}

.af-text {
    margin-top: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--af-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* ANIMAÇÕES GERAIS E SKELETON */
@keyframes af-spin { 100% { transform: rotate(360deg); } }
@keyframes af-spin-reverse { 100% { transform: rotate(-360deg); } }
@keyframes af-pulse { 0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.9); } }

/* CLASSE SKELETON (CRÍTICA PARA O HEADER) */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 0%, #f5f5f5 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: sk-loading 1.5s infinite;
    color: transparent !important;
    border-radius: 6px;
    user-select: none;
    cursor: default;
}
@keyframes sk-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* SEARCH DROPDOWN */
.sidebar-search,
.mobile-menu-search,
.main-header__search-item {
    position: relative;
}
.search-dropdown {
    position: absolute;
    top: 100%; /* Posiciona abaixo do container pai */
    left: 0;
    width: 100%;
    z-index: 1050;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    display: block;
}
.search-dropdown.hidden {
    display: none;
}
.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.search-item:hover {
    background-color: #f5f5f5;
}
.search-item .s-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}
.search-item .s-info {
    display: flex;
    flex-direction: column;
}
.search-item .s-title {
    font-weight: 700;
    font-size: 0.9rem;
}
.search-item .s-desc {
    font-size: 0.8rem;
    color: #666;
}
.search-item-empty {
    padding: 15px;
    text-align: center;
    color: #888;
}