/* =============================
   PetTech BI - SITE.CSS ORGANIZADO
   ============================= */

/* Base HTML settings */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1500&q=80') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
}

/* Loader overlay */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.loader-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 50px 30px;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.spinner {
    border: 8px solid #eee;
    border-top: 8px solid #ffca2c;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.fundo-conteudo {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}



@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-text {
    font-size: 1.15rem;
    color: #3c4257;
}

/* Sidebar */
.bi-sidebar {
    background: #1a2035;
    color: #fff;
    min-height: 100vh;
    border-radius: 2rem 0 0 2rem;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    max-height: 100vh;
}

    .bi-sidebar .nav-link {
        color: #fff;
        font-weight: 500;
        letter-spacing: 0.03em;
        border-radius: 0.8rem;
        margin-bottom: 10px;
    }

        .bi-sidebar .nav-link.active,
        .bi-sidebar .nav-link:hover {
            background: #3c4257;
            color: #ffca2c;
        }

/* Branding */
.brand-logo {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.username-welcome {
    font-size: 1.05rem;
    color: #ffca2c;
}

/* Accordion Menu */
.accordion-button {
    background-color: transparent;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.5rem 0.75rem;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

    .accordion-button.collapsed {
        color: #bbb;
        background-color: transparent;
    }

    .accordion-button:not(.collapsed) {
        background-color: #25282c;
        color: #ffca2c;
    }

.accordion-body {
    padding: 0 0.5rem 0.5rem;
}

.accordion-item {
    border: none;
}

.accordion-body .nav-link {
    color: #ccc;
    font-size: 0.85rem;
    padding-left: 1.25rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

    .accordion-body .nav-link.active {
        background-color: #ffca2c;
        color: #000;
        font-weight: bold;
        border-radius: 4px;
    }

.accordion-button::after {
    filter: invert(1);
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1099;
    display: none;
}

    .sidebar-overlay.ativo {
        display: block;
    }

/* Sidebar Mobile */
@media (max-width: 991.98px) {
    .bi-sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        width: 240px;
        min-width: 240px;
        height: 100vh;
        z-index: 1100;
        border-radius: 0 2rem 2rem 0;
        transition: left 0.3s;
        box-shadow: 2px 0 18px 2px rgba(0, 0, 0, 0.13);
    }

        .bi-sidebar.menu-aberto {
            left: 0;
        }

    .main-container {
        margin-left: 0 !important;
    }
    /* Evita que o conteúdo fique invisível com background de imagem */
    main.main-container {
        background: rgba(255, 255, 255, 0.97); /* cor mais sólida */
        color: #212529; /* texto escuro para melhor contraste */
    }

    #btnMenuMobile {
        display: block !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1110;
        background: rgba(255, 255, 255, 0.85);
        border: none;
        padding: 10px 12px;
        border-radius: 10px;
        box-shadow: 0 2px 6px 0 rgba(50, 50, 50, 0.08);
    }
}

@media (min-width: 992px) {
    #btnMenuMobile,
    .sidebar-overlay {
        display: none !important;
    }
}

/* Footer */
.bi-sidebar footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: auto;
    margin-bottom: 10px;
    padding: 12px 0 6px 0;
    color: #e0e0e0;
}

/* Spinner (bootstrap default override) */
.spinner-border {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    vertical-align: text-bottom;
    border: 0.25em solid #ccc;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}
