/**
 * Namic Disparo - CSS customizado
 * Estilos adicionais sobre o tema Sneat
 */

/* =============================================
   DARK MODE
   ============================================= */
html.dark-style {
    --bs-body-bg: #232333;
    --bs-body-color: #b6bee3;
    --bs-body-bg-rgb: 35, 35, 51;
    --bs-body-color-rgb: 182, 190, 227;
    --bs-border-color: #444564;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1);
    --bs-card-bg: #2b2c40;
    --bs-card-border-color: #444564;
    --bs-card-cap-bg: transparent;
    --bs-heading-color: #cfd3ec;
    --bs-link-color: #696cff;
    --bs-link-hover-color: #787bff;
    --bs-code-color: #e83e8c;
    --bs-highlight-bg: #3d3c2e;
    --bs-white: #2b2c40;
    --bs-light: #2b2c40;
    --bs-light-rgb: 43, 44, 64;
    --bs-dark: #d5d7e4;
    --bs-dark-rgb: 213, 215, 228;
    --bs-gray: rgba(182, 190, 227, 0.1);
    --bs-gray-25: rgba(182, 190, 227, 0.025);
    --bs-gray-50: rgba(182, 190, 227, 0.05);
    color-scheme: dark;
}

html.dark-style body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Navbar dark */
.dark-style .bg-navbar-theme {
    background-color: #2b2c40 !important;
    color: #b6bee3;
}
.dark-style .layout-navbar {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Sidebar dark */
.dark-style .bg-menu-theme {
    background-color: #2b2c40 !important;
    color: #b6bee3;
}
.dark-style .bg-menu-theme .menu-link,
.dark-style .bg-menu-theme .menu-horizontal-prev,
.dark-style .bg-menu-theme .menu-horizontal-next {
    color: #b6bee3;
}
.dark-style .bg-menu-theme .menu-link:hover,
.dark-style .bg-menu-theme .menu-link:focus {
    color: #cfd3ec;
}
.dark-style .bg-menu-theme .menu-item.active > .menu-link {
    color: #cfd3ec;
}
.dark-style .bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
    background-color: #2b2c40;
}
.dark-style .bg-menu-theme .menu-header {
    color: #7983a5;
}
.dark-style .bg-menu-theme .menu-text {
    color: #cfd3ec;
}
.dark-style .bg-menu-theme .menu-inner-shadow {
    background: linear-gradient(#2b2c40 41%, rgba(43, 44, 64, 0.11) 95%, rgba(43, 44, 64, 0));
}
.dark-style .layout-menu {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Cards dark */
.dark-style .card {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .card-header,
.dark-style .card-footer {
    border-color: #444564;
}

/* Tables dark */
.dark-style .table {
    --bs-table-bg: transparent;
    --bs-table-color: #b6bee3;
    --bs-table-border-color: #444564;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
    color: #b6bee3;
}
.dark-style .table thead th {
    border-color: #444564;
    color: #cfd3ec;
}
.dark-style .table td,
.dark-style .table th {
    border-color: #444564;
}

/* Forms dark */
.dark-style .form-control,
.dark-style .form-select {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .form-control:focus,
.dark-style .form-select:focus {
    background-color: #2b2c40;
    border-color: #696cff;
    color: #cfd3ec;
}
.dark-style .form-control::placeholder {
    color: #7983a5;
}
.dark-style .form-label,
.dark-style .col-form-label {
    color: #cfd3ec;
}
.dark-style .input-group-text {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}

/* Buttons dark adjustments */
.dark-style .btn-outline-secondary {
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .btn-outline-secondary:hover {
    background-color: rgba(133, 146, 163, 0.16);
    color: #cfd3ec;
}

/* Dropdown dark */
.dark-style .dropdown-menu {
    background-color: #2b2c40;
    border-color: #444564;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.4);
}
.dark-style .dropdown-item {
    color: #b6bee3;
}
.dark-style .dropdown-item:hover,
.dark-style .dropdown-item:focus {
    background-color: rgba(105, 108, 255, 0.08);
    color: #cfd3ec;
}
.dark-style .dropdown-divider {
    border-color: #444564;
}

/* Modal dark */
.dark-style .modal-content {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .modal-header,
.dark-style .modal-footer {
    border-color: #444564;
}
.dark-style .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Footer dark */
.dark-style .bg-footer-theme {
    background-color: #2b2c40 !important;
    color: #b6bee3;
}
.dark-style .content-footer {
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06);
}

/* Badge labels dark */
.dark-style .bg-label-primary {
    background-color: rgba(105, 108, 255, 0.16) !important;
    color: #696cff !important;
}
.dark-style .bg-label-success {
    background-color: rgba(113, 221, 55, 0.16) !important;
    color: #71dd37 !important;
}
.dark-style .bg-label-danger {
    background-color: rgba(255, 62, 29, 0.16) !important;
    color: #ff3e1d !important;
}
.dark-style .bg-label-warning {
    background-color: rgba(255, 171, 0, 0.16) !important;
    color: #ffab00 !important;
}
.dark-style .bg-label-info {
    background-color: rgba(3, 195, 236, 0.16) !important;
    color: #03c3ec !important;
}
.dark-style .bg-label-secondary {
    background-color: rgba(133, 146, 163, 0.16) !important;
    color: #8592a3 !important;
}

/* Text helpers dark */
.dark-style .text-body,
.dark-style .text-dark {
    color: #cfd3ec !important;
}
.dark-style .text-muted {
    color: #7983a5 !important;
}
.dark-style .text-heading {
    color: #cfd3ec;
}
.dark-style h1, .dark-style h2, .dark-style h3,
.dark-style h4, .dark-style h5, .dark-style h6,
.dark-style .h1, .dark-style .h2, .dark-style .h3,
.dark-style .h4, .dark-style .h5, .dark-style .h6 {
    color: #cfd3ec;
}

/* Misc dark */
.dark-style .page-item .page-link {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .page-item.active .page-link {
    background-color: #696cff;
    border-color: #696cff;
    color: #fff;
}
.dark-style hr {
    border-color: #444564;
}
.dark-style .alert {
    border-color: #444564;
}
.dark-style .list-group-item {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .toast {
    background-color: #2b2c40;
    border-color: #444564;
    color: #b6bee3;
}
.dark-style .avatar-initial {
    color: #696cff;
}
.dark-style .layout-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}
.dark-style .loading-overlay {
    background: rgba(43, 44, 64, 0.8);
}

/* Scrollbar dark */
.dark-style ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.dark-style ::-webkit-scrollbar-track {
    background: #232333;
}
.dark-style ::-webkit-scrollbar-thumb {
    background: #444564;
    border-radius: 3px;
}
.dark-style ::-webkit-scrollbar-thumb:hover {
    background: #5a5c7a;
}

/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
.theme-toggle-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}
.theme-toggle-dropdown .dropdown-item.active {
    background-color: rgba(105, 108, 255, 0.16);
    color: #696cff;
}
.theme-toggle-dropdown .dropdown-item i {
    font-size: 1.25rem;
}

/* =============================================
   ORIGINAL STYLES
   ============================================= */

/* Toast container */
#toast-container {
    z-index: 9999 !important;
}

#toast-container .toast {
    min-width: 300px;
    margin-bottom: 0.5rem;
}

/* Saldo badge no navbar */
#navbar-balance {
    font-size: 0.875rem;
}

/* Contador de caracteres SMS */
.char-counter {
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.2s;
}

.char-counter.text-danger {
    font-weight: 700;
}

/* Área de números textarea */
.numbers-textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 200px;
}

/* Cards de estatísticas no dashboard */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Badge de status */
.status-badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: rgba(105, 108, 255, 0.04);
}

.upload-area .upload-icon {
    font-size: 2.5rem;
    color: var(--bs-primary);
    margin-bottom: 0.5rem;
}

/* Validação visual de números */
.number-valid {
    color: var(--bs-success);
}

.number-invalid {
    color: var(--bs-danger);
    text-decoration: line-through;
}

/* Tabelas responsivas */
.table-responsive .table th {
    white-space: nowrap;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filtros de tabela */
.table-filters {
    background: var(--bs-card-bg);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Login page custom */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alerta de saldo */
.balance-alert {
    border-left: 4px solid;
    animation: fadeIn 0.3s ease-in;
}

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

/* Confirm modal */
#confirmModal .modal-footer {
    border-top: none;
}

/* Pagination */
.pagination .page-link {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

/* Campanhas - dias da semana */
.day-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.day-checkbox.active {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* =============================================
   DASHBOARD
   ============================================= */
.stat-value {
    transition: color .3s;
}
.stat-card .card-body {
    position: relative;
    overflow: hidden;
}
.stat-trend {
    font-size: .7rem;
    font-weight: 600;
}
.stat-trend.up   { color: var(--bs-success); }
.stat-trend.down { color: var(--bs-danger); }
.stat-trend.neutral { color: var(--bs-secondary); }

.pulse-new {
    animation: pulseRow .6s ease-in-out 2;
}
@keyframes pulseRow {
    0%, 100% { background-color: transparent; }
    50%      { background-color: rgba(105, 108, 255, .08); }
}

#dashboard-timer {
    font-size: .7rem;
    opacity: .6;
}

.chart-period-btn.active {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    border-color: var(--bs-primary) !important;
}

/* Print styles para relatórios */
@media print {
    .layout-menu,
    .layout-navbar,
    .content-footer,
    .btn,
    .pagination {
        display: none !important;
    }
    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }
}
