/* ============================================
   RIEVOLUTION - Client Dashboard Styles
   Mobile-First Approach
   ============================================ */

/* === Espaçamento de Ícones no Menu Dropdown === */
.dropdown-menu .dropdown-item i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.navbar .nav-link i {
    margin-right: 5px;
}

/* === Cards de Resumo === */
.card-hover {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* === Tabs Customizadas === */
.nav-tabs-custom {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 600;
    padding: 1rem 0.5rem;
    transition: all 0.3s ease;
    text-align: center;
    background: transparent;
}

.nav-tabs-custom .nav-link:hover {
    border-color: transparent;
    color: #495057;
    background-color: rgba(0, 0, 0, 0.02);
}

.nav-tabs-custom .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: transparent;
}

.nav-tabs-custom .nav-link i {
    font-size: 1.2rem;
}

/* === Responsividade das Tabs (Mobile) === */
@media (max-width: 576px) {
    .nav-tabs-custom .nav-link {
        font-size: 0.85rem;
        padding: 0.75rem 0.25rem;
    }

    .nav-tabs-custom .nav-link i {
        font-size: 1rem;
    }
}

/* === Tabelas Responsivas === */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    cursor: pointer;
}

/* === Botões === */
.btn-action {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-action.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* === Estados Vazios === */
.text-center.py-5 i.fa-4x {
    opacity: 0.3;
}

/* === Cards do Dashboard === */
.profile-container {
    border-radius: 15px;
}

.profile-user-img {
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* === Badges === */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
}

/* === Container de Gráfico === */
.chart-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* === Calendário === */
#calendar {
    background: white;
    padding: 1rem;
    border-radius: 12px;
}

/* === Espaçamento Grid === */
.g-3 {
    gap: 1rem;
}

@media (min-width: 768px) {
    .g-3 {
        gap: 1.5rem;
    }
}

/* === Animações Suaves === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animação suave apenas para tabs ativas - não interferir com Bootstrap */
.tab-pane.active.show {
    animation: fadeIn 0.4s ease;
}

/* Garantir que apenas a tab ativa seja exibida */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* === DataTables Mobile === */
@media (max-width: 768px) {
    table.dataTable thead {
        display: none;
    }

    table.dataTable tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid #dee2e6;
    }

    table.dataTable tbody td:before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
    }

    table.dataTable tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: white;
    }
}

/* === Formulários === */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* === Modal Customizado === */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

/* === SweetAlert2 Custom === */
.swal2-popup {
    border-radius: 12px;
}

/* === Loading States === */
.btn-action.loading {
    position: relative;
    color: transparent;
}

.btn-action.loading:after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* === Utility Classes === */
.text-muted {
    color: #6c757d !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* === Cards Statistics === */
.card-body h2 {
    font-weight: 700;
    font-size: 2.5rem;
}

@media (max-width: 576px) {
    .card-body h2 {
        font-size: 2rem;
    }
}

/* === Responsive Tables Enhancement === */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #495057;
}

.table-light {
    background-color: #f8f9fa;
}

/* === Icons in Tables === */
.table th i,
.table td i {
    margin-right: 0.5rem;
}

/* === Button Groups Mobile === */
.d-grid {
    display: grid;
}

.gap-2 {
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .d-md-flex {
        display: flex !important;
    }

    .justify-content-md-start {
        justify-content: flex-start !important;
    }
}

/* === Accessibility === */
.btn:focus,
.nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .btn,
    .nav-tabs,
    .modal {
        display: none;
    }

    .tab-content {
        display: block !important;
    }

    .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }
}

/* === Dark Mode Support (Future) === */
@media (prefers-color-scheme: dark) {
    /* Prepare for dark mode if needed */
}

/* === Touch Improvements === */
@media (hover: none) {
    .btn-action:hover {
        transform: none;
    }

    .card-hover:hover {
        transform: none;
    }
}

/* === Performance Optimizations === */
* {
    -webkit-tap-highlight-color: transparent;
}

.card,
.btn,
.table {
    will-change: transform;
}

/* === SweetAlert2 Responsive Customization === */
.swal-responsive {
    padding: 1rem !important;
}

.swal-html-responsive {
    text-align: left !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Mobile devices */
@media (max-width: 576px) {
    .swal2-popup {
        width: 95% !important;
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }

    .swal2-title {
        font-size: 1.3rem !important;
        padding: 0.5rem !important;
        word-wrap: break-word !important;
    }

    .swal2-html-container {
        font-size: 0.85rem !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        padding: 0.5rem !important;
    }

    .swal2-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    .swal2-actions button {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }

    .swal2-close {
        font-size: 1.5rem !important;
        padding: 0.5rem !important;
    }

    .swal-html-responsive {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
    }
}

/* Tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .swal2-popup {
        width: 90% !important;
        max-width: 500px !important;
    }

    .swal2-title {
        font-size: 1.5rem !important;
    }

    .swal-html-responsive {
        font-size: 0.9rem !important;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .swal2-popup {
        max-width: 600px !important;
    }
}

/* Estilos para o conteúdo HTML dentro do popup */
.swal2-html-container pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    font-family: inherit !important;
    font-size: inherit !important;
    margin: 0 !important;
}

.swal2-html-container img {
    max-width: 100% !important;
    height: auto !important;
}

.swal2-html-container table {
    width: 100% !important;
    font-size: 0.85rem !important;
}

/* Scrollbar customization para o popup */
.swal2-html-container::-webkit-scrollbar {
    width: 6px;
}

.swal2-html-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.swal2-html-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.swal2-html-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
