/* Estilos globais para o sistema JumpTime */

/* Estilo global para botões arredondados */
.btn {
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

/* Botões de ação primária com cantos mais arredondados */
.btn-primary, .btn-success, .btn-add-to-cart, .btn-danger, .btn-warning {
    border-radius: 10px !important;
}

/* Botões pequenos com cantos proporcionalmente arredondados */
.btn-sm {
    border-radius: 6px !important;
}

/* Botões grandes com cantos mais arredondados */
.btn-lg {
    border-radius: 12px !important;
}

/* Campos de entrada com cantos arredondados */
.form-control, .input-group, .input-group-text {
    border-radius: 8px !important;
}

/* Ajuste para grupos de entrada */
.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .input-group-text:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Cards com cantos mais arredondados */
.card, .modal-content, .toast-item {
    border-radius: 12px !important;
    overflow: hidden;
}

/* Tabelas com cantos arredondados */
.table-responsive, .table {
    border-radius: 8px !important;
    overflow: hidden;
}

/* Badges com cantos bem arredondados */
.badge {
    border-radius: 20px !important;
    padding: 0.35em 0.65em;
}

/* Dropdown menus com cantos arredondados */
.dropdown-menu {
    border-radius: 8px !important;
    overflow: hidden;
}

/* Alertas com cantos arredondados */
.alert {
    border-radius: 10px !important;
}

/* Paginação com cantos arredondados */
.pagination .page-item:first-child .page-link {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.pagination .page-item:last-child .page-link {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Estilos do Carrinho */
.cart-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px 10px 0 0;
}

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: #FF8C00;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    margin-left: 8px;
}

.cart-total-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.cart-total-value {
    color: #FF8C00;
    font-weight: bold;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-price, .cart-item-total {
    font-family: monospace;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-finalize {
    flex: 2;
    background-color: #28a745;
    border-color: #28a745;
    transition: all 0.3s ease;
}

.btn-finalize:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-clear-cart {
    flex: 1;
}

.empty-cart-message {
    padding: 30px 0;
    text-align: center;
}

.empty-cart-message div {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6c757d;
}

.empty-cart-message i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #dee2e6;
}

.empty-cart-message p {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.payment-fields, .cortesia-fields {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos para Métodos de Pagamento */
.payment-method-container {
    margin-top: 10px;
}

.payment-method-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-option {
    position: relative;
    flex: 1;
    min-width: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}

.payment-option:hover {
    border-color: #FF8C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.payment-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.payment-option i {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #6c757d;
}

.payment-option span {
    font-size: 0.9rem;
    font-weight: 500;
}

.payment-option.active {
    border-color: #FF8C00;
    background-color: #fff8f0;
}

.payment-option.active i {
    color: #FF8C00;
}

/* Animações para campos de pagamento */
.payment-fields, .cortesia-fields {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.payment-fields[style*="block"], .cortesia-fields[style*="block"] {
    opacity: 1;
    max-height: 500px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Animações para itens do carrinho */
@keyframes highlightItem {
    0% { background-color: #fff8f0; }
    100% { background-color: transparent; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Estilo para itens do carrinho */
#cartItems tr {
    transition: all 0.3s ease;
}

#cartItems tr:not(#emptyCartRow) {
    animation: slideInRight 0.3s ease;
}

#cartItems tr.highlight {
    animation: highlightItem 1.5s ease;
}

#cartItems tr.removing {
    animation: fadeOut 0.3s ease forwards;
}

/* Estilo para botões de quantidade no carrinho */
.input-group-sm .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.input-group-sm .btn-outline-secondary:hover {
    background-color: #e9ecef;
    color: #495057;
}

.input-group-sm input[type="number"] {
    text-align: center;
    font-weight: 500;
}

/* Remover setas do input number */
.input-group-sm input[type="number"]::-webkit-inner-spin-button,
.input-group-sm input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group-sm input[type="number"] {
    -moz-appearance: textfield;
}

/* Estilos para informações do cliente */
.customer-info-card {
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.customer-info-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.customer-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.customer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-avatar i {
    font-size: 2rem;
    color: #FF8C00;
}

.customer-name {
    display: flex;
    flex-direction: column;
}

.customer-name h5 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.customer-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.customer-badge.active {
    background-color: #e6f7e6;
    color: #28a745;
}

.customer-info-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-label {
    display: flex;
    align-items: center;
    width: 120px;
    color: #6c757d;
    font-weight: 500;
}

.info-label i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.info-value {
    flex: 1;
    font-weight: 500;
    color: #333;
}

/* Animação para mostrar informações do cliente */
.show-customer-info {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Melhorias na dropdown de clientes */
.customer-dropdown {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    max-height: 250px;
}

.customer-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    transition: all 0.2s ease;
}

.customer-dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.customer-dropdown-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.customer-dropdown-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.customer-dropdown-item strong {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.customer-dropdown-item small {
    color: #6c757d;
}

/* Melhorias na seção de busca de clientes */
.customer-header {
    background-color: #f8f9fa;
    border-left: 4px solid #FF8C00;
}

.customer-search-section {
    padding: 0.5rem 0;
}

.customer-search-container {
    position: relative;
}

.search-input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.search-input-group .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
    color: #FF8C00;
}

.search-input-group .form-control {
    border-left: none;
    border-right: none;
    padding-left: 0;
}

.search-input-group .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

.search-btn {
    background-color: #FF8C00;
    border-color: #FF8C00;
    transition: all 0.3s ease;
}

.search-btn:hover, 
.search-btn:focus {
    background-color: #e67e00;
    border-color: #e67e00;
    box-shadow: 0 0 0 0.25rem rgba(255, 140, 0, 0.25);
}

.customer-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.1rem;
}

/* Animação para o dropdown de clientes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.customer-dropdown {
    position: absolute;
    width: 100%;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    animation: fadeInDown 0.3s ease;
}

.customer-dropdown.show {
    display: block;
}

/* Estilos para os itens do dropdown de clientes */
.customer-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customer-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-item-avatar i {
    font-size: 1.25rem;
    color: #FF8C00;
}

.customer-item-info {
    display: flex;
    flex-direction: column;
}

.customer-item-info strong {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 2px;
}

.customer-item-info small {
    color: #6c757d;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.customer-item-info small i {
    font-size: 0.9rem;
}

/* Estilo para mensagem de nenhum resultado encontrado */
.no-results-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
}

.no-results-found i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-results-found p {
    margin-bottom: 1rem;
}

.no-results-found button {
    font-size: 0.85rem;
}

/* Toast Notifications */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    padding: 12px 20px;
    border-radius: 8px;
    background-color: white;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    min-width: 280px;
    max-width: 400px;
    animation: fadeIn 0.3s forwards;
    border-left: 4px solid;
}

.toast-item i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.toast-item.success {
    border-left-color: #28a745;
}

.toast-item.success i {
    color: #28a745;
}

.toast-item.error {
    border-left-color: #dc3545;
}

.toast-item.error i {
    color: #dc3545;
}

.toast-item.warning {
    border-left-color: #ffc107;
}

.toast-item.warning i {
    color: #ffc107;
}

.toast-item.info {
    border-left-color: #17a2b8;
}

.toast-item.info i {
    color: #17a2b8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========================================
   PWA - PROGRESSIVE WEB APP STYLES
   ======================================== */

/* Modo PWA instalado */
html.pwa-mode {
    /* Remover barra de endereço no PWA */
    height: 100%;
    overflow: hidden;
}

html.pwa-mode body {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Safe areas para dispositivos com notch */
@supports (padding-top: env(safe-area-inset-top)) {
    .sidebar {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
    
    .main-content {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    html.pwa-mode .sidebar {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
}

/* ========================================
   RESPONSIVIDADE GLOBAL MELHORADA
   ======================================== */

/* Touch-friendly targets */
@media (pointer: coarse) {
    .btn, 
    .nav-link, 
    .form-control, 
    .form-select,
    .dropdown-item,
    .list-group-item {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .btn-sm {
        min-height: 36px;
    }
    
    .table td, .table th {
        padding: 12px 8px;
    }
}

/* Prevenção de zoom em iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea {
    font-size: 16px !important;
}

/* ========================================
   DISPOSITIVOS MÓVEIS (< 576px)
   ======================================== */
@media (max-width: 575.98px) {
    /* Layout geral */
    body {
        font-size: 14px;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-header {
        padding: 10px 12px;
    }
    
    /* Tipografia */
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.1rem; }
    h5, .h5 { font-size: 1rem; }
    h6, .h6 { font-size: 0.9rem; }
    
    /* Botões */
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 10px 16px;
        font-size: 16px;
    }
    
    /* Formulários */
    .form-label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .form-control, .form-select {
        padding: 10px 12px;
    }
    
    /* Tabelas */
    .table {
        font-size: 13px;
    }
    
    .table th, .table td {
        padding: 8px 6px;
    }
    
    /* Modais */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Badges */
    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Grid - Forçar stack */
    .row > [class*="col-"] {
        padding-left: 6px;
        padding-right: 6px;
    }
    
    /* Sidebar oculta por padrão */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 60px 10px 20px;
    }
    
    /* Toggle button visível */
    .sidebar-toggle {
        display: flex !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1100;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: #667eea;
        border: none;
        border-radius: 8px;
        color: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    /* Overlay quando sidebar aberta */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* ========================================
   TABLETS (576px - 991.98px)
   ======================================== */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Sidebar mais estreita */
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    /* Cards em 2 colunas */
    .card-body {
        padding: 15px;
    }
    
    /* Tabelas */
    .table {
        font-size: 14px;
    }
}

/* ========================================
   DESKTOP GRANDE (> 1400px)
   ======================================== */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* ========================================
   ORIENTAÇÃO LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        padding-top: 10px;
    }
    
    .sidebar .logo-container {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .sidebar .logo-container img {
        max-width: 100px;
    }
    
    .sidebar .nav-link {
        padding: 8px 15px;
    }
    
    .main-content {
        padding-top: 10px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .sidebar,
    .sidebar-toggle,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a[href]:after {
        content: none !important;
    }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

/* Focus visível */
:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Reduzir movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000 !important;
    }
    
    .btn {
        border: 2px solid currentColor !important;
    }
}

/* ========================================
   DARK MODE (para futuro uso)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Preparado para implementação futura */
}

/* ========================================
   INSTALAÇÃO PWA - Banner
   ======================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-install-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pwa-install-banner .banner-icon {
    font-size: 2rem;
}

.pwa-install-banner .banner-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.pwa-install-banner .banner-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-banner .banner-actions {
    display: flex;
    gap: 10px;
}

.pwa-install-banner .btn-install {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.pwa-install-banner .btn-install:hover {
    transform: scale(1.05);
}

.pwa-install-banner .btn-close-banner {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .pwa-install-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }
    
    .pwa-install-banner .banner-content {
        flex-direction: column;
    }
    
    .pwa-install-banner .banner-actions {
        width: 100%;
        justify-content: center;
    }
}
