/* Steampunk Admin Styles */

/* Base Layout */
body {
    background-color: #2f1e0f;
    color: #e8c39e;
    font-family: 'Cinzel', serif;
}

.steampunk-dashboard {
    min-height: 100vh;
    background: url('parchment-bg.jpg') repeat;
    background-size: cover;
}

.sidebar {
    background-color: #3c2f2f;
    padding: 10px;
    border-right: 3px solid #d4a017;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    width: 125px;
}

.content {
    padding: 20px;
    background-color: rgba(232, 195, 158, 0.9);
    color: #3c2f2f;
}

/* Typography */
.engraved-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #732020; /* Darkened from #d4a017 to improve readability */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #d4a017;
    padding-bottom: 5px;
    text-align: center;
    font-size: 1.2em;
}

/* Specific titles to match sidebar background */
.control-deck-title,
.active-vendors-title {
    color: #3c2f2f;
}

.ledger-text {
    color: #3c2f2f;
    font-size: 1.1em;
}

/* Navigation */
.gear-nav .nav-link {
    color: #e8c39e;
    font-size: 1.2em;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
}

.gear-nav .nav-link:hover,
.gear-nav .nav-link.active {
    color: #d4a017;
    background-color: rgba(212, 160, 23, 0.2);
    border-radius: 5px;
}

.gear-nav .nav-link::before {
    content: "⚙";
    margin-right: 10px;
    color: #d4a017;
}

.gear-nav .nav-item {
    margin-bottom: 10px;
    text-align: center;
}

.gear-nav .nav-btn {
    width: 56px;
    height: 56px;
    background-color: #F5E6D3;
    border: 3px outset #d4a017;
    color: #3c2f2f;
    font-family: 'Cinzel', serif;
    transition: all 0.3s ease;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6),
                -2px -2px 4px rgba(212, 160, 23, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.gear-nav .nav-btn:hover {
    background-color: #d4a017;
    color: #3c2f2f;
    border-style: inset;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6),
                -1px -1px 3px rgba(212, 160, 23, 0.4);
}

.gear-nav .nav-btn i {
    margin: 0;
    font-size: 1.5em;
}

.gear-nav .nav-btn .nav-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.gear-nav .nav-btn.active {
    color: #d4a017;
    background-color: rgba(212, 160, 23, 0.2);
    border-style: inset;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.4),
                inset -2px -2px 4px rgba(212, 160, 23, 0.3);
}

.welcome-plate {
    color: #e8c39e;
    background-color: #732020;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* Forms */
.gear-form label {
    color: #3c2f2f;
    font-weight: bold;
}

.gear-input input,
.gear-input select,
.gear-input textarea {
    background-color: #f5e6d3;
    border: 1px solid #d4a017;
    color: #3c2f2f;
    border-radius: 5px;
}

.gear-input input:focus,
.gear-input select:focus,
.gear-input textarea:focus {
    border-color: #732020;
    box-shadow: 0 0 5px rgba(115, 32, 32, 0.5);
}

/* Buttons */
.steampunk-btn {
    background-color: #732020;
    border: 2px solid #d4a017;
    color: #e8c39e;
    font-family: 'Cinzel', serif;
    transition: all 0.3s ease;
}

.steampunk-btn:hover {
    background-color: #d4a017;
    color: #3c2f2f;
    border-color: #732020;
}

/* Tables */
.riveted-table {
    background-color: #f5e6d3;
    border: 3px solid #d4a017;
    color: #3c2f2f;
}

.riveted-table th {
    background-color: #732020;
    color: #e8c39e;
    border-bottom: 2px solid #d4a017;
}

.riveted-table td {
    border-top: 1px solid #d4a017;
}

.riveted-table tr.table-success td {
    font-weight: bold;
    background-color: #d4e7d4;
}

/* Smaller font size in the sales modal table */
#salesModal .riveted-table {
    font-size: 0.85em;
}

#salesModal .riveted-table th,
#salesModal .riveted-table td {
    padding: 5px;
    white-space: nowrap;
}

/* Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gauge-widget,
.ledger-widget,
.log-widget {
    background-color: #f5e6d3;
    padding: 15px;
    border: 2px solid #d4a017;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.gauge-container {
    text-align: center;
}

.gauge-label {
    font-size: 1.2em;
    color: #732020;
}

.total-vendors-label {
    color: #2f1e0f !important;
}

.gauge-value {
    font-size: 2.5em;
    color: #3c2f2f;
    display: block;
    margin-top: 10px;
}

.widget-title {
    color: #732020;
    font-size: 1.3em;
    border-bottom: 1px solid #d4a017;
    padding-bottom: 5px;
}

.log-list {
    list-style: none;
    padding: 0;
    color: #3c2f2f;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    background-color: #ffffff;
    border: 1px solid #d4a017;
    border-radius: 5px;
}

.log-list li {
    padding: 5px 10px;
    border-bottom: 1px dashed #d4a017;
    cursor: pointer;
}

.log-list li:hover {
    background-color: rgba(212, 160, 23, 0.2);
}

/* jQuery UI Selectable Styles */
.ui-selectable .ui-selecting {
    background: rgba(212, 160, 23, 0.4);
}

.ui-selectable .ui-selected {
    background: rgba(212, 160, 23, 0.6);
    color: #3c2f2f;
}

/* Feedback Alerts */
.form-feedback {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-feedback.fadeIn {
    opacity: 1;
}

.form-feedback.alert-success {
    background-color: #28a745;
    color: #fff;
    border-color: #1e7e34;
}

.form-feedback.alert-danger {
    background-color: #a32929;
    color: #fff;
    border-color: #732020;
}

/* Modal */
.steampunk-modal {
    background-color: #f5e6d3;
    border: 3px solid #d4a017;
    color: #3c2f2f;
}

.steampunk-modal .modal-header {
    background-color: #732020;
    color: #e8c39e;
    border-bottom: 2px solid #d4a017;
}

.steampunk-modal .btn-close {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(180deg);
}

/* Chart Container */
.chart-container {
    width: 100%;
    height: 180px;
    margin: 10px auto;
    position: relative;
}

/* FadeIn Animation */
.fadeIn {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Handsontable Specific Styles from pos.php */
#sale-entries-hot .htCore tr {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#sale-entries-hot .htCore td {
    padding: 2px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.handsontable .htDropdown {
    border: 1px solid #d4a017 !important;
    background-color: #f5e6d3 !important;
    color: #3c2f2f !important;
    border-radius: 3px !important;
    padding: 0 2px !important;
    font-size: 0.9rem !important;
    height: 20px !important;
    line-height: 20px !important;
    max-height: 20px !important;
    overflow: hidden !important;
}

.handsontable .htDropdown:focus {
    border-color: #732020 !important;
    box-shadow: 0 0 3px rgba(115, 32, 32, 0.5) !important;
}

.handsontable .ht_master .htAutocompleteWrapper {
    background-color: #f5e6d3 !important; /* Light beige fallback */
    color: #3c2f2f !important;
}

/* Enhanced selectors for Handsontable dropdown menu */
.handsontable .handsontableInputHolder.ht_editor_visible .htAutocompleteWrapper table.htCore,
.handsontable .handsontableInputHolder.ht_editor_visible .ht_menu,
.handsontable .handsontableInputHolder.ht_editor_visible .ht_autocomplete,
.handsontable .htAutocompleteWrapper,
.handsontable .ht_menu {
    background-color: #f5e6d3 !important; /* Light beige for dropdown menu */
    color: #3c2f2f !important;
    border: 1px solid #d4a017 !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) !important;
}

#sale-entries-hot {
    width: 100% !important;
    max-width: 1400px !important;
    min-width: 800px !important;
}

/* Handsontable Header Styles */
.handsontable th {
    background-color: #732020 !important; /* Matches .riveted-table th */
    color: #e8c39e !important;
    border: 1px solid #d4a017 !important;
}

/* DataTable Specific Styles for Sales Ledger */
#sales-ledger {
    font-size: 0.75em; /* Smaller font size to fit more content */
}

#sales-ledger th,
#sales-ledger td {
    padding: 4px 6px !important; /* Reduced padding for compactness */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow content */
    text-overflow: ellipsis; /* Add ellipsis for truncated text */
    line-height: 1.2; /* Tight line height */
    vertical-align: middle; /* Center content vertically */
}

#sales-ledger .btn-sm {
    padding: 2px 5px; /* Smaller buttons to match compact rows */
    font-size: 0.7em; /* Smaller button text */
}

/* DataTable Pagination Styles */
#sales-ledger_wrapper .dataTables_paginate .paginate_button {
    background-color: #732020 !important;
    border: 2px solid #d4a017 !important;
    color: #e8c39e !important;
    font-family: 'Cinzel', serif !important;
    transition: all 0.3s ease !important;
    padding: 2px 8px !important;
    margin: 0 2px !important;
    border-radius: 0 !important;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6) !important;
}

#sales-ledger_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #d4a017 !important;
    color: #3c2f2f !important;
    border-color: #732020 !important;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6) !important;
}

#sales-ledger_wrapper .dataTables_paginate .page-item.active .page-link,
#sales-ledger_wrapper .dataTables_paginate .paginate_button.current,
#sales-ledger_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: #d4a017 !important;
    background: #d4a017 !important; /* Override any background gradients */
    color: #3c2f2f !important;
    border: 2px solid #732020 !important;
    border-style: inset !important;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.4) !important;
    text-decoration: none !important;
}

#sales-ledger_wrapper .dataTables_paginate .page-item.disabled .page-link,
#sales-ledger_wrapper .dataTables_paginate .paginate_button.disabled,
#sales-ledger_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background-color: #3c2f2f !important;
    color: #e8c39e !important;
    border-color: #732020 !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

#sales-ledger_wrapper .dataTables_paginate .paginate_button.previous,
#sales-ledger_wrapper .dataTables_paginate .paginate_button.next {
    font-size: 0.8em !important; /* Slightly smaller for compactness */
}

/* Ensure Bootstrap pagination overrides are suppressed */
#sales-ledger_wrapper .dataTables_paginate .page-link {
    background-color: inherit !important;
    color: inherit !important;
    border: none !important; /* Remove Bootstrap border */
}