/* 
  Global CSS - App Banco
  This file contains the core layout, common components, and responsive grid 
  used throughout the application.
*/

:root {
    --primary-color: #4caf50;
    --primary-color-rgb: 76, 175, 80;
}

/* Base Layout */
body {
    background: var(--body-bg, linear-gradient(145deg, #f5f7fa, #e4eaf1));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px;
    margin: 0;
    color: var(--text-main, #212529);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* The Main Container */
.card-central {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    padding: 2rem 1.8rem;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    padding-bottom: 5rem;
    /* Pushed to center vertically and horizontally */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Floating Menu Button */
.menu-banco-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
    z-index: 1050;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-banco-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.menu-banco-btn:active {
    transform: scale(0.95);
}

.menu-banco-btn.hide-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Typography & Subtitles */
.subtitulo {
    color: var(--text-secondary, #6c757d);
    font-size: 1rem;
    margin-bottom: 1.8rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    line-height: 1.4;
}

/* Utilities */
.hover-bg-light:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* Dark Mode Helper Classes */
[data-bs-theme="dark"] .table {
    color: var(--text-main) !important;
}

/* Formulários */
.form-control,
.form-select,
.input-group-text {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-color);
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .alert-info {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    color: var(--text-main);
}

/* Modais e Offcanvas */
.modal-content,
.offcanvas {
    background-color: var(--modal-bg, #fff) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--card-border) !important;
    opacity: 1 !important;
}

.modal-header,
.offcanvas-header {
    border-bottom: 1px solid var(--card-border) !important;
}

.modal-footer {
    border-top: 1px solid var(--card-border) !important;
}

/* Responsiveness (Mobile Full Screen) */
@media (max-width: 768px) {
    body {
        width: 100%;
        padding: 0;
    }

    .menu-floating-wrapper {
        margin: 0 !important;
        height: 0;
        min-height: 0;
    }

    .card-central {
        align-self: stretch;
        width: 100%;
        height: 100%;
        min-width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100dvh;
        padding-top: 5rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        padding-bottom: 5rem;
    }

    .menu-banco-btn {
        top: 30px;
        left: 12px;
        z-index: 1100;
        cursor: grab;
        width: auto;
        height: auto;
        border-radius: 50rem;
        padding: 0.375rem 1.5rem;
        font-size: 20px;
    }

    .menu-banco-btn:active {
        cursor: grabbing;
    }
}

@media (max-width: 400px) {
    .card-central {
        padding-left: 1rem;
        padding-right: 1rem;
        margin-top: 0;
    }
}

/* Menu Header dinâmico */
.menu-user-header {
    background-color: var(--primary-color);
    transition: background-color 0.3s ease;
}

#menuAccordion .menu-section {
    border-bottom: 1px solid var(--card-border);
}

#menuAccordion .menu-section:last-child {
    border-bottom: none;
}

/* Loading Spinner Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.spinner-container {
    background: var(--card-bg);
    padding: 1.5rem 2.5rem;
    border-radius: 24px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--card-border);
}

.spinner-banco {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(var(--primary-color-rgb), 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

[data-bs-theme="dark"] #loading-overlay {
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
    #menuBanco {
        width: 100vw !important;
    }
}

@media (max-width: 768px) {
    .menu-banco-btn {
        top: 12px;
        left: 1.25rem;
        right: auto;

    }
}

/* Modo Offline (PWA) */
body.app-offline {
    filter: grayscale(0.5);
    transition: filter 0.5s ease;
}

.home-card {
    position: absolute;
    min-height: 95dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.home-acoes {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    gap: .5rem;
    z-index: 1040;
}
@media (max-width: 768px) {
    .home-card {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding-top: 5rem !important;
    }
}