/**
 * Midnight Carbon Theme
 * Ultra-dark carbon fiber aesthetic with blue accents
 */

:root {
    --bs-primary: #1e40af;
    --bs-primary-rgb: 30, 64, 175;
    --bs-secondary: #60a5fa;
    --bs-secondary-rgb: 96, 165, 250;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-info: #06b6d4;
    --bs-info-rgb: 6, 182, 212;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #f87171;
    --bs-danger-rgb: 248, 113, 113;
    --bs-light: #1e1e1e;
    --bs-light-rgb: 30, 30, 30;
    --bs-dark: #080808;
    --bs-dark-rgb: 8, 8, 8;
    
    --bs-body-bg: #080808;
    --bs-body-color: #e5e7eb;
    --bs-card-bg: #1e1e1e;
    --bs-border-color: #374151;
}

/* Simple gradient background */
body {
    background: linear-gradient(135deg, #080808 0%, #1e1e1e 50%, #080808 100%);
    background-attachment: fixed;
    color: var(--bs-body-color);
}

/* Subtle static glow overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(30, 64, 175, 0.08) 0%,
        rgba(30, 64, 175, 0.04) 40%,
        transparent 70%
    );
    z-index: -1;
    opacity: 0.5;
}

/* Card styling */
.card {
    background: linear-gradient(145deg, #1e1e1e, #0f0f0f);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Materials cards specific styling */
.materials-card {
    background: linear-gradient(145deg, #1e1e1e, #0f0f0f);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Materials table transparent background */
.materials-card .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: 0 0 var(--bs-card-border-radius) var(--bs-card-border-radius);
    overflow: hidden;
}

.materials-card .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

.materials-card .table th:first-child {
    border-top-left-radius: 0;
}

.materials-card .table th:last-child {
    border-top-right-radius: 0;
}

.materials-card .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

.materials-card .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

.materials-card .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* Step guide table transparent background */
#stepguideSection .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: var(--bs-card-border-radius);
    overflow: hidden;
}

#stepguideSection .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

#stepguideSection .table th:first-child {
    border-top-left-radius: var(--bs-card-border-radius);
}

#stepguideSection .table th:last-child {
    border-top-right-radius: var(--bs-card-border-radius);
}

#stepguideSection .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

#stepguideSection .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

#stepguideSection .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* Inventory Management table styling */
#inventoryTable .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: var(--bs-card-border-radius);
    overflow: hidden;
}

#inventoryTable .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

#inventoryTable .table th:first-child {
    border-top-left-radius: var(--bs-card-border-radius);
}

#inventoryTable .table th:last-child {
    border-top-right-radius: var(--bs-card-border-radius);
}

#inventoryTable .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

#inventoryTable .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

#inventoryTable .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* History table styling - matches inventory table */
#historyTable .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: var(--bs-card-border-radius);
    overflow: hidden;
}

#historyTable .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

#historyTable .table th:first-child {
    border-top-left-radius: var(--bs-card-border-radius);
}

#historyTable .table th:last-child {
    border-top-right-radius: var(--bs-card-border-radius);
}

#historyTable .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

#historyTable .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

#historyTable .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* Custom Blueprint Research table styling */
#customBlueprints .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: var(--bs-card-border-radius);
    overflow: hidden;
}

#customBlueprints .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

#customBlueprints .table th:first-child {
    border-top-left-radius: var(--bs-card-border-radius);
}

#customBlueprints .table th:last-child {
    border-top-right-radius: var(--bs-card-border-radius);
}

#customBlueprints .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

#customBlueprints .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

#customBlueprints .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* Custom Prices NEW table styling (matching Custom Blueprints) */
#customPricesNewList .table {
    background: transparent;
    color: var(--bs-body-color);
    border-radius: var(--bs-card-border-radius);
    overflow: hidden;
}

#customPricesNewList .table th {
    background: transparent;
    color: white;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    padding-left: 1rem;
    padding-right: 1rem;
}

#customPricesNewList .table th:first-child {
    border-top-left-radius: var(--bs-card-border-radius);
}

#customPricesNewList .table th:last-child {
    border-top-right-radius: var(--bs-card-border-radius);
}

#customPricesNewList .table td {
    background: transparent;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
    padding-left: 1rem;
    padding-right: 1rem;
}

#customPricesNewList .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--bs-card-border-radius);
}

#customPricesNewList .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--bs-card-border-radius);
}

/* Settings Tabs - Match Card Header Styling */
.nav-tabs {
    border-bottom: 1px solid var(--bs-border-color);
}

.nav-tabs .nav-link {
    background: linear-gradient(145deg, #1e1e1e, #0f0f0f);
    border: 1px solid var(--bs-border-color);
    border-bottom: none;
    color: var(--bs-body-color);
    margin-right: 2px;
    border-radius: 0.375rem 0.375rem 0 0;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: var(--bs-secondary);
    border-color: var(--bs-border-color);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(145deg, #1e1e1e, #0f0f0f);
    border-color: var(--bs-border-color);
    border-bottom: 1px solid transparent;
    color: var(--bs-secondary);
    font-weight: 600;
}

/* Navigation */
.navbar-dark {
    background: linear-gradient(145deg, #080808 0%, #1e1e1e 50%, #080808 100%) !important;
    border-bottom: 2px solid var(--bs-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.navbar-brand {
    color: var(--bs-secondary) !important;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.8);
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--bs-primary), #1d4ed8);
    border: 1px solid var(--bs-primary);
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, var(--bs-primary));
    box-shadow: 0 6px 15px rgba(30, 64, 175, 0.5);
    transform: translateY(-1px);
}

/* Form controls */
.form-control, .form-select {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
}

.form-control:focus, .form-select:focus {
    background: rgba(30, 30, 30, 1);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
    color: var(--bs-body-color);
}

/* Select dropdown options */
.form-select option {
    background: rgba(30, 30, 30, 0.95);
    color: var(--bs-body-color);
}

/* Dropdown menus */
.dropdown-menu {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    color: var(--bs-body-color);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(30, 64, 175, 0.2);
    color: var(--bs-body-color);
}

.dropdown-item.active {
    background: var(--bs-primary);
    color: white;
}

.dropdown-header {
    color: var(--bs-secondary);
    font-weight: 600;
}

.dropdown-divider {
    border-color: var(--bs-border-color);
}

/* Tables */
.table-dark {
    --bs-table-bg: rgba(30, 30, 30, 0.9);
    --bs-table-striped-bg: rgba(55, 65, 81, 0.3);
    --bs-table-border-color: var(--bs-border-color);
}

.table-dark th {
    background: linear-gradient(135deg, var(--bs-primary), #1d4ed8);
    color: white;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #080808 0%, #1e1e1e 50%, rgba(30, 64, 175, 0.3) 100%);
    color: white;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.6);
}

/* Manufacturing steps */
.manufacturing-step {
    border-left: 4px solid var(--bs-success);
}

.reaction-step {
    border-left: 4px solid var(--bs-secondary);
}

.capital-component-step {
    border-left: 4px solid var(--bs-primary);
}

/* Cost indicators */
.cost-positive {
    color: var(--bs-success);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.cost-negative {
    color: var(--bs-secondary);
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

/* Special effects for badges */
.badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    background: #080808;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--bs-primary), var(--bs-secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--bs-secondary), var(--bs-primary));
}