/* ============================================
   BLACKFRAY - Estilos Gerais (Porta 8090)
   Tema: Black Friday / Dark Mode
   ============================================ */

/* === RESET E BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* === LOGIN SCREEN === */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.login-container {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.login-container .logo,
.login-container img[alt*="Logo"],
.login-container img[alt*="logo"],
#logo1 {
    display: block;
    margin: 0 auto 20px;
    max-width: 180px !important;
    width: 100% !important;
    height: auto !important;
}

#logo-container {
    padding-top: 3vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

@media (min-width: 768px) {
    #logo1 {
        max-width: 240px !important;
    }
}

.login-container h2 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-container .subtitle {
    color: #888;
    text-align: center;
    margin-bottom: 30px;
    font-size: 13px;
}

/* === FORMULÁRIOS === */
.form-control, .form-select {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: #252525;
    border-color: #FFC043;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 192, 67, 0.15);
}

.form-control::placeholder {
    color: #666;
}

.form-label {
    color: #ccc;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
}

/* === BOTÕES === */
.btn-primary {
    background: linear-gradient(135deg, #FFC043 0%, #FE825E 50%, #ED4A81 100%);
    border: none;
    color: #000;
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 24px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 192, 67, 0.3);
    background: linear-gradient(135deg, #FFD063 0%, #FE926E 50%, #F05A91 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary, .btn-outline-light {
    background-color: #1e1e1e;
    border-color: #444;
    color: #ccc;
    border-radius: 8px;
}

.btn-secondary:hover, .btn-outline-light:hover {
    background-color: #2a2a2a;
    border-color: #666;
    color: #fff;
}

/* === NAVBAR === */
.navbar {
    background-color: #111 !important;
    border-bottom: 1px solid #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    color: #fff !important;
    font-weight: 600;
}

/* === CARDS === */
.card {
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    color: #e0e0e0;
}

/* === TABELAS === */
.table {
    color: #e0e0e0;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #1a1a1a;
}

.table thead th {
    background-color: #1a1a1a;
    border-color: #333;
    color: #aaa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    border-color: #222;
    vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
}

/* === SIDEBAR === */
.sidebar {
    background-color: #0f0f0f;
    border-right: 1px solid #222;
    min-height: 100vh;
    width: 260px;
}

.sidebar .nav-link {
    color: #888;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: #1e1e1e;
}

.sidebar .nav-link.active {
    color: #FFC043;
    background-color: #1a1a1a;
    font-weight: 600;
}

/* === SIDEBAR CUSTOM (Menu Lateral) === */
:root {
    --sidebar-width: 280px;
}

.sidebar-custom {
    position: fixed;
    top: 0;
    left: -300px;
    width: var(--sidebar-width);
    height: 100vh;
    background: #141414;
    border-right: 1px solid #2a2a2a;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-custom.active {
    left: 0;
}

.sidebar-custom .sidebar-header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 15px 20px;
}

.sidebar-custom .sidebar-content {
    padding: 15px;
}

.sidebar-group-title {
    color: #FFC043;
    font-size: 11px;
    letter-spacing: 1px;
    padding-left: 12px;
    margin-bottom: 12px;
}

.sidebar-custom .sidebar-link {
    color: #aaa;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    padding: 10px 12px;
}

.sidebar-custom .sidebar-link:hover {
    background-color: #1e1e1e;
    color: #fff;
}

.sidebar-custom .sidebar-link.active {
    background-color: rgba(255, 192, 67, 0.1);
    color: #FFC043;
    border-left-color: #FFC043;
}

.sidebar-custom .sidebar-link i {
    color: #888;
    transition: color 0.2s;
}

.sidebar-custom .sidebar-link:hover i,
.sidebar-custom .sidebar-link.active i {
    color: #FFC043;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === MODAIS === */
.modal-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    color: #e0e0e0;
}

.modal-header {
    border-bottom-color: #333;
}

.modal-footer {
    border-top-color: #333;
}

/* === BADGES === */
.badge {
    font-weight: 500;
    border-radius: 6px;
    padding: 4px 10px;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* === UTILITÁRIOS === */
.text-warning-custom {
    color: #FFC043 !important;
}

.bg-gradient-brand {
    background: linear-gradient(135deg, #FFC043 0%, #FE825E 50%, #ED4A81 100%);
}

/* SweetAlert Dark Theme */
.swal-modal {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
}

.swal-title {
    color: #fff;
}

.swal-text {
    color: #ccc;
}

/* === MODAL NEGOcio Link === */
.modal-negocio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-negocio-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease;
}

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

.modal-negocio-header {
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
}

.modal-negocio-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-negocio-body {
    padding: 24px;
    color: #ccc;
}

.modal-negocio-body p {
    margin-bottom: 12px;
}

.modal-negocio-card {
    background: #252525;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    color: #FFC043;
    font-size: 16px;
    text-align: center;
}

.modal-negocio-card small {
    color: #888;
}

.modal-negocio-select {
    width: 100%;
    background: #252525;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 12px;
    cursor: pointer;
}

.modal-negocio-select:focus {
    border-color: #FFC043;
    outline: none;
}

.modal-negocio-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #333;
    border-radius: 0 0 16px 16px;
    justify-content: flex-end;
}

.modal-negocio-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-negocio-btn-cancelar {
    background: #2a2a2a;
    color: #888;
    border: 1px solid #444;
}

.modal-negocio-btn-cancelar:hover {
    background: #333;
    color: #fff;
}

.modal-negocio-btn-confirmar {
    background: linear-gradient(135deg, #FFC043 0%, #FE825E 100%);
    color: #000;
}

.modal-negocio-btn-confirmar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 192, 67, 0.3);
}

.modal-negocio-btn-confirmar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* === TOAST NOTIFICATION === */
.bf-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: bf-toast-slide-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.bf-toast-success { background: #28a745; }
.bf-toast-error { background: #dc3545; }

@keyframes bf-toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === MOBILE TABLE RESPONSIVENESS === */
@media only screen and (max-width: 767px) {
    #table_01-treetable-outer-container.treetable-outer-container {
        overflow-x: auto !important;
        overflow-y: auto !important;
        width: 100%;
        height: auto !important;
        max-height: 55vh;
    }

    #table_01-treetable.treetable {
        width: 400% !important;
        min-width: 400% !important;
        table-layout: fixed;
    }
}

/* === TABLE TEXT COLOR === */
.treetable td,
.treetable td > div {
    color: #000 !important;
}

.treetable-body tr {
    color: #000 !important;
}

/* === MOBILE - AUMENTAR ICONES E CONTROLES === */
@media only screen and (max-width: 767px) {
    /* Header icons - maiores para toque */
    .header-icons {
        font-size: 36px !important;
        padding: 8px !important;
        min-width: 48px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-icons svg {
        width: 36px;
        height: 36px;
    }

    /* Sidebar - links maiores */
    .sidebar-custom .sidebar-link {
        padding: 16px 16px !important;
        font-size: 16px !important;
        min-height: 52px;
        display: flex;
        align-items: center;
    }

    .sidebar-custom .sidebar-link i {
        font-size: 22px !important;
        margin-right: 12px;
    }

    /* Botoes - maiores */
    .btn {
        min-height: 48px;
        font-size: 16px !important;
        padding: 14px 24px !important;
        border-radius: 10px !important;
    }

    /* Form controls - maiores */
    .form-control, .form-select {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 14px 18px !important;
    }

    /* Search bar */
    #search_input_01 {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 14px 18px !important;
    }

    /* Modal botoes de acao */
    .modal-negocio-btn {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 14px 28px !important;
    }

    /* SweetAlert botoes */
    .swal-button {
        min-height: 52px !important;
        font-size: 16px !important;
        padding: 14px 28px !important;
    }

    /* Toast - maior */
    .bf-toast {
        font-size: 14px !important;
        padding: 16px 24px !important;
        min-height: 48px;
        bottom: 16px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none;
    }

    /* Tabela - tamanho da fonte */
    .treetable td, .treetable th {
        font-size: 14px !important;
        padding: 12px 10px !important;
    }

    /* Paginacao */
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }

    /* Login - logo menor e container responsivo */
    .login-container {
        padding: 24px 20px !important;
        margin: 16px !important;
        max-width: none !important;
        width: calc(100% - 32px) !important;
    }

    .login-container .logo,
    .login-container img[alt*="Logo"],
    .login-container img[alt*="logo"] {
        max-width: 120px !important;
    }
}
