/* Estilos gerais */
* {
    font-family: 'Open Sans', sans-serif !important;
}

/* Garantir que os ícones Font Awesome sejam exibidos */
.fas, .far, .fab, .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

.card .fas {
    font-size: 3rem !important;
}

/* Fallback para ícones Unicode quando Font Awesome não carrega */
.fas:empty::before {
    content: attr(aria-hidden);
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 3rem !important;
    font-weight: normal !important;
}

html, body {
    overflow-x: hidden; /* Remove scroll horizontal */
    max-width: 100%;
}

body {
    background-color: #f8f9fa;
    font-family: 'Open Sans', sans-serif;
    padding-top: 80px; /* Espaço para o navbar fixo */
}

.container, .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Espaçamento específico para a seção de Configurações */
#configuracoes-section {
    padding-bottom: 30px; /* Espaçamento normal */
    margin-bottom: 20px; /* Margem inferior normal */
}

.configuracoes-spacing {
    min-height: calc(100vh - 200px); /* Altura mínima normal */
}

/* Estilos para galeria de logos */
.logo-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background-color: white;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.logo-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

.logo-item.ativo {
    border-color: #28a745;
    background-color: #f8fff9;
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
}

.logo-item {
    position: relative;
}

.btn-remover-logo {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.btn-remover-logo:hover {
    opacity: 1;
    background: #c82333;
}

.logo-info {
    font-size: 0.9rem;
}

.logo-nome {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

/* Remover scroll do navbar */
.navbar {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.navbar .container,
.navbar-collapse,
.navbar-nav {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

/* Remover scrollbars do navbar */
.navbar::-webkit-scrollbar,
.navbar .container::-webkit-scrollbar,
.navbar-collapse::-webkit-scrollbar,
.navbar-nav::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.navbar,
.navbar .container,
.navbar-collapse,
.navbar-nav {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.navbar-brand {
    font-weight: bold;
}

/* Centralização do menu */
.navbar .container {
    position: relative;
    display: flex;
    align-items: center;
}

.navbar-brand {
    position: absolute;
    left: 15px;
    z-index: 1000;
}

.navbar-collapse {
    flex-grow: 1;
    justify-content: center;
}

.navbar-collapse.show {
    display: flex !important;
}

/* Para telas maiores, sempre mostrar o menu */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
    }
}

.navbar-nav {
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.nav-item {
    margin: 0 10px;
}

.nav-link {
    padding: 8px 16px !important;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Estilos para o navbar-toggler */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
    background: transparent;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

/* Ajustes para responsividade do menu centralizado */
@media (max-width: 991.98px) {
    .navbar-brand {
        position: relative;
        z-index: auto;
    }
    
    .navbar .container {
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .navbar-toggler {
        margin-left: auto;
        order: 2;
    }
    
    .navbar-collapse {
        justify-content: flex-start;
        order: 3;
        width: 100%;
        margin-top: 10px;
        flex-basis: 100%;
    }
    
    .navbar-collapse.show {
        display: flex !important;
        flex-direction: column;
    }
    
    .navbar-nav {
        margin: 0;
        text-align: center;
        width: 100%;
        flex-direction: column;
    }
    
    .nav-item {
        margin: 5px 0;
        width: 100%;
    }
    
    .nav-link {
        text-align: center;
        width: 100%;
        padding: 10px 15px !important;
    }
}

.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    font-weight: bold;
}

/* Estilos para as seções */
.section {
    display: none;
    padding-bottom: 30px; /* Espaçamento normal para todas as seções */
    margin-bottom: 20px; /* Margem inferior normal */
}

.section.active {
    display: block;
}

/* Estilos para tabelas */
.table th {
    background-color: #f0f0f0;
}

/* Estilos para botões de ação */
.btn-action {
    margin-right: 5px;
}

/* Estilos específicos para ícones SVG nos botões */
.btn-action img, .btn img {
    display: inline-block;
    vertical-align: middle;
    filter: brightness(0) invert(1); /* Garante que os ícones sejam brancos */
}

.btn-danger img {
    filter: brightness(0) invert(1); /* Ícones brancos em botões vermelhos */
}

.btn-outline-danger img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%); /* Ícones vermelhos em botões outline */
}

/* Estilos para o formulário */
.form-label {
    font-weight: 500;
}

/* Estilos para o total do orçamento */
#total-orcamento {
    font-size: 1.1em;
    color: #232E59;
}

/* Garantir largura total para seções específicas */
#clientes-section .card,
#clientes-section .table-responsive,
#clientes-section .card-body {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 15px;
    padding-right: 15px;
}

#clientes-section .table-responsive {
    padding-left: 0;
    padding-right: 0;
}

/* Estilos do Rodapé */
.site-footer {
    background: linear-gradient(135deg, #232E59 0%, #1a2142 100%);
    color: #ffffff;
}

.site-footer p {
    color: inherit;
}

.site-footer a {
    color: inherit;
}

/* Estilos da seção de histórico */
#historico-section .filtros-historico {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

#historico-section .filtros-historico .row {
    align-items: end;
}

#historico-section .table-historico {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#historico-section .table-historico th {
    background-color: #232E59;
    color: white;
    border: none;
    font-weight: 600;
    text-align: center;
}

#historico-section .table-historico td {
    vertical-align: middle;
    text-align: center;
    border-color: #dee2e6;
}

#historico-section .btn-acao {
    margin: 0 2px;
    padding: 5px 10px;
    font-size: 12px;
}

#historico-section .produtos-lista {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal de visualização de orçamento */
.modal-orcamento .modal-dialog {
    max-width: 90%;
}

.modal-orcamento .detalhes-orcamento {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.modal-orcamento .produtos-detalhes {
    max-height: 300px;
    overflow-y: auto;
}

.modal-orcamento .imagem-aeronave {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}

/* Galeria de imagens do cliente */
#galeria-cliente-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

#galeria-cliente .card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

#galeria-cliente .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#galeria-cliente .card-img-top {
    border-radius: 0.375rem 0.375rem 0 0;
}

#galeria-cliente .card-body {
    background-color: white;
}

#galeria-cliente .btn-danger {
    width: 100%;
}

/* Galeria de imagens no histórico */
.galeria-imagens-historico {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.card-imagem-historico {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.card-imagem-historico:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-imagem-historico img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.card-imagem-historico .info-imagem {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-imagem-historico .info-imagem small {
    font-size: 0.75rem;
    line-height: 1.2;
}

.btn-excluir-historico {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-excluir-historico:hover {
    background-color: #dc3545;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    #historico-section .filtros-historico {
        padding: 15px;
    }
    
    #historico-section .table-responsive {
        font-size: 14px;
    }
    
    #historico-section .btn-acao {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    .modal-orcamento .modal-dialog {
        max-width: 95%;
        margin: 10px;
    }
    
    #galeria-cliente .col-6 {
        margin-bottom: 1rem;
    }
    
    .galeria-imagens-historico {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        max-height: 250px;
    }
    
    .card-imagem-historico img {
        height: 80px;
    }
    
    .btn-excluir-historico {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Estilos para galeria de imagens de aeronaves */
.galeria-imagens .thumbnail-container {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
}

.galeria-imagens .thumbnail-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.galeria-imagens .thumbnail-container.selected {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.galeria-imagens .thumbnail-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
}

.galeria-imagens .thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 5px;
}

.galeria-imagens .thumbnail-container:hover .thumbnail-overlay {
    opacity: 1;
}

.galeria-imagens .thumbnail-container.selected .thumbnail-overlay {
    opacity: 1;
    background: rgba(40, 167, 69, 0.8);
}

.galeria-imagens .thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 11px;
    text-align: center;
}

.galeria-imagens .btn-remover {
    position: absolute;
    top: 5px;
    right: 5px;
    width: auto;
    height: 28px;
    border-radius: 4px;
    background: #dc3545;
    border: none;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.galeria-imagens .thumbnail-container:hover .btn-remover {
    opacity: 1;
}

.galeria-imagens .btn-remover:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* Estilos para galeria de aeronaves */
#aeronave-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

#aeronave-gallery .gallery-item {
    position: relative;
    max-width: 250px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

#aeronave-gallery .gallery-item:hover {
    border-color: #007bff;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

#aeronave-gallery .gallery-item.active {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

#aeronave-gallery .gallery-item img {
    width: 100%;
    max-width: 250px;
    height: auto;
    display: block;
    object-fit: cover;
}

#aeronave-gallery .gallery-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#aeronave-gallery .gallery-item:hover .remove-btn {
    opacity: 1;
}

#aeronave-gallery .gallery-item .remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}