/* Estilos para a interface móvel */

/* ==========================================================================
   Mobile Dashboard
   ========================================================================== */
body.device-mobile .mobile-dashboard {
    padding: 1rem;
    background-color: #f4f7f9;
}

body.device-mobile .stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: #fff;
    padding: 0.6rem 0.3rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

body.device-mobile .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 calc(50% - 0.25rem);
    min-width: 0;
    padding: 0.3rem 0.2rem;
}

body.device-mobile .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

body.device-mobile .stat-label {
    font-size: 0.55rem;
    color: #666;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.1;
    margin-top: 0.2rem;
    word-break: break-word;
}

body.device-mobile .nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

body.device-mobile .nav-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

body.device-mobile .nav-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.device-mobile .nav-grid-item-icon {
    margin-bottom: 0.5rem;
    color: #0d6efd;
}

body.device-mobile .nav-grid-item-label {
    font-size: 0.85rem;
    font-weight: 500;
}


/* ==========================================================================
   Responsive Tables
   ========================================================================== */

/* Ocultar a header da tabela em dispositivos móveis */
body.device-mobile .table-responsive-custom thead {
    display: none;
}

/* Transformar a tabela e suas partes em blocos */
body.device-mobile .table-responsive-custom,
body.device-mobile .table-responsive-custom tbody,
body.device-mobile .table-responsive-custom tr,
body.device-mobile .table-responsive-custom td {
    display: block;
    width: 100%;
}

/* Estilizar as linhas como "cards" */
body.device-mobile .table-responsive-custom tr {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Adicionar os labels dos cabeçalhos antes de cada célula */
body.device-mobile .table-responsive-custom td {
    padding-left: 50%;
    position: relative;
    text-align: right;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

body.device-mobile .table-responsive-custom td:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

body.device-mobile .table-responsive-custom td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 45%;
    padding-left: 1rem;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

/* ==========================================================================
   Ajustes Gerais para Mobile
   ========================================================================== */

/* Reduzir o padding geral do conteúdo */
body.device-mobile .main-body {
    padding: 0.5rem;
}

/* Aumentar o tamanho da fonte para melhor legibilidade */
body.device-mobile {
    font-size: 16px;
}

/* Garantir que os modais ocupem mais da tela */
body.device-mobile .modal-dialog {
    max-width: 95%;
    margin: 0.5rem auto;
}

/* Ajustar modais de proprietário para mobile */
body.device-mobile #proprietario-modal .modal-dialog {
    max-width: 100%;
    margin: 0.5rem;
}

body.device-mobile #proprietario-modal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
}

body.device-mobile #proprietario-modal .modal-body {
    padding: 0.75rem;
    max-height: calc(95vh - 120px);
    overflow-y: auto;
}

body.device-mobile #proprietario-modal .mb-1,
body.device-mobile #proprietario-modal .row {
    margin-bottom: 0.75rem !important;
}

body.device-mobile #proprietario-modal .form-label {
    margin-bottom: 0.25rem !important;
    font-size: 0.9rem !important;
}

body.device-mobile #proprietario-modal .form-control,
body.device-mobile #proprietario-modal .form-control-sm {
    padding: 0.5rem !important;
    font-size: 0.95rem !important;
}

body.device-mobile #proprietario-modal h5,
body.device-mobile #proprietario-modal h6 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}

body.device-mobile #proprietario-modal .modal-header {
    padding: 0.75rem;
}

body.device-mobile #proprietario-modal .modal-footer {
    padding: 0.5rem 0.75rem !important;
}

body.device-mobile #proprietario-modal .row {
    margin-left: 0;
    margin-right: 0;
}

body.device-mobile #proprietario-modal .row > [class*="col-"] {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/* Ajustar modais de imóvel para mobile */
body.device-mobile #novo-imovel-modal .modal-dialog,
body.device-mobile #edit-imovel-modal .modal-dialog {
    max-width: 100%;
    margin: 0.5rem;
}

body.device-mobile #novo-imovel-modal .modal-content,
body.device-mobile #edit-imovel-modal .modal-content {
    max-height: 95vh;
    overflow-y: auto;
}

body.device-mobile #novo-imovel-modal .modal-body,
body.device-mobile #edit-imovel-modal .modal-body {
    padding: 0.75rem;
    max-height: calc(95vh - 120px);
    overflow-y: auto;
}

body.device-mobile #novo-imovel-modal .mb-3,
body.device-mobile #edit-imovel-modal .mb-3 {
    margin-bottom: 0.75rem !important;
}

body.device-mobile #novo-imovel-modal .form-label,
body.device-mobile #edit-imovel-modal .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

body.device-mobile #novo-imovel-modal .form-control,
body.device-mobile #edit-imovel-modal .form-control {
    padding: 0.5rem;
    font-size: 0.95rem;
}

body.device-mobile #novo-imovel-modal h5,
body.device-mobile #edit-imovel-modal h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

body.device-mobile #novo-imovel-modal .modal-header,
body.device-mobile #edit-imovel-modal .modal-header {
    padding: 0.75rem;
}

body.device-mobile #novo-imovel-modal .modal-footer,
body.device-mobile #edit-imovel-modal .modal-footer {
    padding: 0.5rem 0.75rem;
}

body.device-mobile #novo-imovel-modal .row,
body.device-mobile #edit-imovel-modal .row {
    margin-left: 0;
    margin-right: 0;
}

body.device-mobile #novo-imovel-modal .row > [class*="col-"],
body.device-mobile #edit-imovel-modal .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

/* Ajustar modais de participação para mobile */
body.device-mobile #edit-participacao-modal .modal-dialog,
body.device-mobile #nova-versao-modal .modal-dialog {
    max-width: 100%;
    margin: 0.25rem;
}

body.device-mobile #edit-participacao-modal .modal-content,
body.device-mobile #nova-versao-modal .modal-content {
    max-height: 98vh;
    overflow-y: auto;
}

body.device-mobile #edit-participacao-modal .modal-body,
body.device-mobile #nova-versao-modal .modal-body {
    padding: 0.5rem;
    max-height: calc(98vh - 100px);
    overflow-y: auto;
}

body.device-mobile #edit-participacao-modal .mb-2,
body.device-mobile #nova-versao-modal .mb-2 {
    margin-bottom: 0.35rem !important;
}

body.device-mobile #edit-participacao-modal .mb-3,
body.device-mobile #nova-versao-modal .mb-3 {
    margin-bottom: 0.5rem !important;
}

body.device-mobile #edit-participacao-modal .mt-3,
body.device-mobile #nova-versao-modal .mt-3 {
    margin-top: 0.5rem !important;
}

body.device-mobile #edit-participacao-modal .form-label,
body.device-mobile #nova-versao-modal .form-label {
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}

body.device-mobile #edit-participacao-modal .form-control,
body.device-mobile #nova-versao-modal .form-control {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    height: auto;
}

body.device-mobile #edit-participacao-modal h5,
body.device-mobile #nova-versao-modal h5 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

body.device-mobile #edit-participacao-modal .modal-header,
body.device-mobile #nova-versao-modal .modal-header {
    padding: 0.5rem;
}

body.device-mobile #edit-participacao-modal .modal-footer,
body.device-mobile #nova-versao-modal .modal-footer {
    padding: 0.4rem 0.5rem;
}

body.device-mobile #edit-participacao-modal .fw-bold,
body.device-mobile #nova-versao-modal .fw-bold {
    font-size: 0.85rem;
}

body.device-mobile #edit-participacao-modal .modal-title,
body.device-mobile #nova-versao-modal .modal-title {
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Botões específicos dos modais de participação - mais compactos */
body.device-mobile #edit-participacao-modal .btn,
body.device-mobile #nova-versao-modal .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

body.device-mobile #edit-participacao-modal .btn-close,
body.device-mobile #nova-versao-modal .btn-close {
    width: 0.8rem;
    height: 0.8rem;
    padding: 0.25rem;
    font-size: 0.7rem;
}

/* Estilos para botões para serem mais fáceis de tocar */
body.device-mobile .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
body.device-mobile .bottom-nav-item {
    padding: 0.25rem;
    font-size: 0.65rem; /* Reduz o tamanho da fonte para caber mais itens */
}

body.device-mobile .bottom-nav-item i {
    font-size: 1.2em; /* Ajusta o tamanho do ícone */
}

body.device-mobile .bottom-nav-items {
    justify-content: space-around; /* Garante espaçamento uniforme */
}

/* Floating Action Button (FAB) */
.btn-fab {
    position: fixed;
    bottom: 80px; /* Adjust to be above the bottom nav bar */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1050; /* Ensure it's above other content but below modals */
}

/* ==========================================================================
   Alugueis Mobile Styles
   ========================================================================== */

/* Container with padding top to accommodate fixed filters */
body.device-mobile .alugueis-container-mobile {
    position: relative;
    padding-top: 140px; /* Space for the fixed filters card */
}

/* Make the search filters fixed at the top */
body.device-mobile .alugueis-container-mobile .sticky-filters-card {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* Reduce font size for Ano and Mês labels and selects */
body.device-mobile .alugueis-container-mobile .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

body.device-mobile .alugueis-container-mobile .form-select {
    font-size: 0.875rem;
}

/* Ensure the card body has proper padding */
body.device-mobile .alugueis-container-mobile .sticky-filters-card .card-body {
    padding: 1rem;
}

/* List container with bottom padding */
body.device-mobile .alugueis-container-mobile #alugueis-list-mobile {
    padding-bottom: 2rem;
}

/* ==========================================================================
   Relatorios Mobile Styles
   ========================================================================== */

/* Container needs to allow scrolling */
body.device-mobile .relatorios-container-mobile {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

/* Make the search filters sticky when scrolling */
body.device-mobile .relatorios-container-mobile .sticky-filters-card {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Reduce font size for Ano and Mês labels and selects */
body.device-mobile .relatorios-container-mobile .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

body.device-mobile .relatorios-container-mobile .form-select {
    font-size: 0.875rem;
}

/* Ensure the card body has proper padding */
body.device-mobile .relatorios-container-mobile .sticky-filters-card .card-body {
    padding: 1rem;
}

/* List container with bottom padding */
body.device-mobile .relatorios-container-mobile #relatorios-list-mobile {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}
