/* Import Chakra Petch font */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

:root {
    /* Light theme variables */
    --main-bg-color: #f4f4f4;
    --panel-bg-color: #ffffff;
    --text-color: #333333;
    --secondary-text-color: #666666;
    --border-color: #333333;
    --header-bg-color: #ffffff;
    --button-bg-color: #f5f5f5;
    --button-hover-color: #e0e0e0;
    --accent-color: #3d8bf8;
    --accent-hover-color: #2d7be8;
    --accent-hover: #2d7be8;
    --tree-hover-color: #f5f5f5;
    --item-selected-color: rgba(61, 139, 248, 0.15);
    --search-highlight-color: #ffeb3b;
    --scroll-thumb-color: #cccccc;
    --scroll-track-color: #f1f1f1;
    --toggle-bg-color: #cccccc;
    --toggle-active-bg: #3d8bf8;
    --card-shadow: none;
    --focus-outline: 0 0 0 1px rgba(61, 139, 248, 0.5);
    --stats-changed: #66bb6a;
    --button-text: #333333;
    --background-primary: #ffffff;
    --background-secondary: #f8f8f8;
    --input-bg-color: #ffffff;
    --button-hover-bg: #e0e0e0;
}

.dark-theme {
    /* Dark theme variables */
    --main-bg-color: #000000;
    --panel-bg-color: #121212;
    --text-color: #e0e0e0;
    --secondary-text-color: #aaaaaa;
    --border-color: #333333;
    --header-bg-color: #121212;
    --button-bg-color: #1e1e1e;
    --button-hover-color: #2a2a2a;
    --accent-color: #3d8bf8;
    --accent-hover-color: #2d7be8;
    --accent-hover: #2d7be8;
    --tree-hover-color: #1e1e1e;
    --item-selected-color: rgba(61, 139, 248, 0.15);
    --search-highlight-color: #8B6000;
    --scroll-thumb-color: #444444;
    --scroll-track-color: #1e1e1e;
    --toggle-bg-color: #444444;
    --toggle-active-bg: #3d8bf8;
    --card-shadow: none;
    --focus-outline: 0 0 0 1px rgba(61, 139, 248, 0.5);
    --stats-changed: #66bb6a;
    --button-text: #e0e0e0;
    --background-primary: #121212;
    --background-secondary: #1a1a1a;
    --input-bg-color: #2a2a2a;
    --button-hover-bg: #2a2a2a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--main-bg-color);
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header styling like Reward Selector */
header {
    background-color: var(--main-bg-color);
    border-bottom: 1px solid #333;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

/* Panel controls - matches Reward Selector */
.panel-controls {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0;
}

/* Header right controls container */
.header-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Home button styling */
.home-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(61, 139, 248, 0.1);
    color: var(--accent-color);
    text-decoration: none;
    /*border-radius: 4px;*/
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    margin: 0;
}

.home-button:hover {
    background-color: rgba(61, 139, 248, 0.2);
    border-left: 1px solid var(--accent-color);
    transform: scale(1.05);
}

.home-button svg {
    width: 20px;
    height: 20px;
}

/* Header button styling - matches Reward Selector */
.header-button {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    white-space: nowrap;
}

.header-button:hover {
    background-color: var(--button-hover-color);
}

/* Refresh button specific styling */
#refresh-table-button {
    font-size: 18px;
    width: 36px;
    padding: 0;
}

#refresh-table-button:hover {
    background-color: #4CAF50;
    color: white;
}

/* Refresh button animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.header-button:active {
    background-color: var(--button-hover-color);
}

/* File operation buttons - subtle blue tint */
#load-csv,
#load-components,
#load-config,
#save-config,
#file-menu-button {
    background-color: rgba(61, 139, 248, 0.08);
    border-color: rgba(61, 139, 248, 0.2);
}

#load-csv:hover,
#load-components:hover,
#load-config:hover,
#save-config:hover,
#file-menu-button:hover {
    background-color: rgba(61, 139, 248, 0.15);
    border-color: rgba(61, 139, 248, 0.3);
}

/* Special styling for Save Config button */
#save-config {
    background-color: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.2);
    color: var(--text-color);
}

#save-config:hover {
    background-color: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
}

/* Dark theme specific styling for file operation buttons */
.dark-theme #load-csv,
.dark-theme #load-components,
.dark-theme #load-config,
.dark-theme #file-menu-button {
    background-color: rgba(61, 139, 248, 0.12);
    color: #a8c7ff;
}

.dark-theme #save-config {
    background-color: rgba(76, 175, 80, 0.12);
    color: #90ee90;
}

.dark-theme #load-csv:hover,
.dark-theme #load-components:hover,
.dark-theme #load-config:hover,
.dark-theme #file-menu-button:hover {
    background-color: rgba(61, 139, 248, 0.2);
    color: #c0d7ff;
}

.dark-theme #save-config:hover {
    background-color: rgba(76, 175, 80, 0.2);
    color: #98ff98;
}

/* Category buttons container - FIXED */
.category-buttons-container {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 0;
}

/* Category button styling */
.category-button {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
}

.category-button:hover {
    background-color: var(--button-hover-color);
}

.category-button.active {
    background-color: var(--accent-color);
    color: white;
}

.upload-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.2s;
}

.upload-button:hover {
    background-color: var(--accent-hover-color);
}

/* Main app container */
#app-container {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

/* Ship stats container */
.ship-stats-container {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top scrollbar container */
.top-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    background-color: var(--panel-bg-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.top-scroll-content {
    height: 30px;
}

.ship-stats-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg-color);
    width: 100%;
}

.ship-stats-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.ship-stats-header .panel-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: auto !important;
}

/* More specific rule for ship comparison buttons */
.ship-stats-container .ship-stats-header .panel-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-left: auto !important;
}

.ship-stats-table-container {
    padding: 0;
    margin: 0;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide the bottom scrollbar for WebKit browsers */
.ship-stats-table-container::-webkit-scrollbar {
    display: none;
}

#ship-comparison-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
    margin: 0;
    padding: 0;
}

#ship-comparison-table th,
#ship-comparison-table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
}

#ship-comparison-table th.stat-header {
    width: 250px;
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: var(--panel-bg-color);
    text-align: left;
}

#ship-comparison-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: var(--panel-bg-color);
    text-align: left;
    font-weight: 500;
    width: 180px;
    color: var(--text-color);
}

.ship-header {
    background-color: var(--button-bg-color);
    border-bottom: none !important;
    padding: 8px !important;
    cursor: grab;
}

.ship-header.dragging {
    cursor: grabbing;
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.ship-drag-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 14px;
    margin-bottom: 5px;
    cursor: grab;
}

.ship-drag-handle::before {
    content: "⋮⋮";
    color: var(--secondary-text-color);
    font-size: 16px;
    line-height: 1;
    letter-spacing: 2px;
}

.ship-drag-handle:hover::before {
    color: var(--text-color);
}

.drag-placeholder {
    background-color: rgba(61, 139, 248, 0.15);
    border: 2px dashed var(--accent-color);
}

/* Flexbox layout for ship header content */
.ship-column-header {
    display: flex;
    flex-direction: column;
    padding: 8px;
}

/* Dropdowns container */
.selectors-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px !important;
    width: 100%;
}

/* Style the dropdowns */
.ship-column-header select {
    width: 100%;
    font-size: 12px;
    height: 32px;
    margin-bottom: 4px;
}

/* Config container with buttons */
.config-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px !important;
}

.config-dropdown {
    flex: 1;
}

/* Style the ship control buttons as icon buttons */
.ship-control-btn {
    background-color: var(--button-bg-color) !important;
    color: var(--button-text) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 3px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: 'Chakra Petch', sans-serif !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    height: 36px !important;
    width: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ship-control-btn:hover {
    background-color: var(--button-hover-bg) !important;
}

/* Ship selector button styling */
.ship-selector-btn {
    background-color: #222 !important;
    color: white !important;
    text-align: left !important;
    font-weight: normal !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

.ship-selector-btn:hover {
    background-color: #333 !important;
}

.ship-selector,
.config-dropdown {
    width: 100% !important;
    font-size: 14px !important;
    height: 36px !important;
    padding: 0 8px !important;
    margin: 0 !important;
}

/* This style is overridden in the inline styles */
.ship-selector {
    margin-bottom: 0 !important;
}

.sub-header {
    background-color: var(--button-bg-color);
    font-size: 11px;
    text-align: center !important;
    padding: 4px !important;
    min-width: 110px;
    color: var(--text-color);
}

.base-value,
.modified-value {
    text-align: right;
    min-width: 110px;
}

.add-ship-column {
    background-color: rgb(18, 18, 18);
    text-align: center;
    padding: 10px !important;
    border-bottom: none !important;
}

.add-ship-btn {
    font-size: 11px;
    padding: 6px 12px;
    width: auto;
}

/* Add button styling */
.add-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: var(--accent-hover-color);
}

/* Ship configs container */
.ship-configs-container {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    padding: 0;
    margin: 20px 0 0 0;
    width: 100%;
}

.ship-configs-container h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

#ship-config-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px;
    width: 100%;
}

/* Ship panel styling for configs */
.ship-config-panel {
    flex: 1 1 400px;
    min-width: 300px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
}

.ship-config-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--button-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ship-config-header h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.ship-config-content {
    padding: 12px;
}

/* Ship column in table */
.ship-column {
    min-width: 200px;
    background-color: rgb(18, 18, 18);
    border-bottom: none;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    margin-left: auto;
    align-self: flex-end;
}

.remove-ship-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

/* Split view styling */
.split-view {
    display: flex;
    gap: 15px;
    position: relative;
}

.ship-display {
    flex: 1;
    min-width: 200px;
}

.resize-handle {
    width: 8px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
    flex: 0 0 8px;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
    background-color: var(--accent-color);
}

/* Panel styling */
.panel {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg-color);
}

.panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-content {
    padding: 14px;
    height: 100%;
    overflow-y: auto;
}

/* Section styles */
.config-section,
.components-section,
.stats-section {
    margin-top: 20px;
}

.config-section h3,
.components-section h3,
.stats-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

/* Ship selector styling */
select {
    width: 100%;
    padding: 10px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    /*margin-top: 10px;*/
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
}

select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
}

/* Configuration buttons */
.config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.config-list button {
    padding: 6px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: all 0.2s;
}

.config-list button:hover {
    background-color: var(--button-hover-color);
}

.config-list button.selected {
    background-color: var(--accent-color);
    color: white;
}

/* Add configuration button */
#add-config-1,
#add-config-2 {
    padding: 8px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 13px;
    transition: all 0.2s;
}

#add-config-1:hover,
#add-config-2:hover {
    background-color: var(--button-hover-color);
}

/* Component cards */
.component-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.component-card {
    border: 2px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    background-color: var(--panel-bg-color);
    transition: all 0.2s;
    width: calc(50% - 5px);
}

.component-card.selected {
    background-color: var(--item-selected-color);
    border-color: var(--accent-color);
}

.component-card:hover {
    border-color: var(--accent-color);
}

/* Stats table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.stats-changed {
    color: #4CAF50 !important;
    /* Green for increased values */
    font-weight: bold;
    position: relative;
    padding-left: 6px;
    /* Add padding to compensate for the ::before bar */
    text-align: right !important;
    /* Maintain right alignment */
}

.stats-changed span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-changed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #4CAF50;
}

.stats-decreased {
    color: #ff6b6b !important;
    /* Red for decreased values */
    font-weight: bold;
    position: relative;
    padding-left: 6px;
    /* Add padding to compensate for the ::before bar */
    text-align: right !important;
    /* Maintain right alignment */
}

.stats-decreased span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-decreased::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ff6b6b;
}

.stats-neutral {
    color: #3d8bf8 !important;
    /* Blue for neutral modifications */
    font-weight: bold;
    position: relative;
    padding-left: 6px;
    /* Add padding to compensate for the ::before bar */
    text-align: right !important;
    /* Maintain right alignment */
}

.stats-neutral span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-neutral::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3d8bf8;
}

/* Component category headers */
.component-category-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    padding: 12px 16px;
    background-color: var(--header-bg-color);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

/* Style the count in category headers */
.component-category-header::after {
    content: attr(data-count);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    display: none;
}

.component-category-header[data-count]::after {
    display: block;
}

/* Style the count numbers in category headers to be orange */
.component-category-header .category-count {
    color: #ff9800;
    font-weight: 600;
}

/* Component type headers */
.component-type-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--secondary-text-color);
    margin: 15px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Component type labels */
.component-type-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 190px;
    display: inline-block;
    margin-right: 15px;
}

/* Component category sections */
.component-category-section {
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--panel-bg-color);
    overflow: hidden;
}

.component-category-section h4 {
    font-family: 'Chakra Petch', sans-serif;
    margin: 0;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--button-bg-color);
    border-bottom: 1px solid var(--border-color);
}

/* Component slots */
.component-slot {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.component-slot:last-child {
    border-bottom: none;
}

.slot-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    width: 200px;
    letter-spacing: 0.5px;
}

/* Component dropdowns */
.component-dropdown {
    flex: 1;
    padding: 8px 12px;
    background-color: rgba(255, 165, 0, 0.08);
    color: var(--text-color);
    border: 1.5px solid #e79e00;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 1px 4px 0 rgba(255, 165, 0, 0.08);
    transition: background 0.2s, border-color 0.2s;
}

.component-dropdown:focus,
.component-dropdown:hover {
    background-color: rgba(255, 165, 0, 0.16);
    border-color: #e79e00;
    outline: none;
}

.component-dropdown option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* Responsive styles */
@media (min-width: 1024px) {
    .panel {
        min-height: 700px;
    }

    .component-card {
        width: calc(33.33% - 7px);
    }
}

@media (max-width: 1023px) {
    .split-view {
        flex-direction: column;
    }

    .resize-handle {
        display: none;
    }

    .ship-display {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .component-slot {
        flex-direction: column;
        align-items: flex-start;
    }

    .slot-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .component-dropdown {
        width: 100%;
    }
}

@media (min-resolution: 1.5dppx) {
    .ship-drag-handle {
        height: 24px;
    }

    .ship-drag-handle::before {
        font-size: 24px;
    }

    .ship-header {
        padding: 12px !important;
    }

    .remove-ship-btn,
    .add-ship-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .ship-selector,
    .config-dropdown {
        padding: 8px;
        font-size: 14px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Modal dialog */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: #3d8bf8;
    font-size: 18px;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: var(--button-hover-color);
    color: var(--text-color);
}

.modal-content label {
    display: block;
    color: var(--secondary-text-color);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content select:focus {
    outline: none;
    border-color: #3d8bf8;
    box-shadow: 0 0 0 2px rgba(61, 139, 248, 0.2);
}

.modal-content input[type="text"]::placeholder {
    color: var(--secondary-text-color);
}

.add-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.add-button:hover {
    background-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(61, 139, 248, 0.3);
}

.add-button:active {
    transform: translateY(0);
}

/* Main content layout */
.main-content {
    flex: 1;
    width: 100%;
    transition: margin-right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content.panel-open {
    margin-right: 400px;
    /* Width of the components panel */
}

/* Components panel */
.components-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.components-panel.open {
    opacity: 1;
    visibility: visible;
}

.components-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

.components-panel-title-area {
    display: flex;
    flex-direction: column;
}

.components-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.components-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    letter-spacing: 0.5px;
}

.components-panel-header .config-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.components-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

/* Add styles for the components-container */
#components-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.stats-column,
.components-column {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.stats-column {
    border-right: 1px solid var(--border-color);
    padding: 0;
    margin: 0;
    height: 100%;
    overflow-y: auto;
}

.components-column {
    flex: 1;
    padding: 20px;
    padding-bottom: 50px;
    /* Extra padding at bottom for scrolling */
    overflow-y: auto;
}

/* Close button */
.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.close-button:hover {
    color: #ff6b6b;
}

/* Stats panel within components panel */
.stats-preview {
    border: 1px solid var(--border-color);
    background-color: rgba(18, 18, 18, 0.2);
    border-radius: 3px;
    margin-bottom: 20px;
}

.stats-preview h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    color: var(--secondary-text-color);
    margin: 0;
    padding: 10px 14px;
    background-color: rgba(18, 18, 18, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.stats-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.stats-preview-table th,
.stats-preview-table td {
    padding: 6px 8px;
}

.stats-preview-table th {
    background-color: rgba(18, 18, 18, 0.6);
    text-align: center;
    font-weight: 600;
}

.stats-preview-table tr:nth-child(even) {
    background-color: var(--tree-hover-color);
}

/* Stat cells styling with info button */
.stats-preview-table tbody td:first-child {
    position: relative;
    user-select: none;
}

/* Info button styling */
.stat-info-button {
    background: transparent;
    border: 1px solid #666;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.stat-info-button:hover {
    background: rgba(61, 139, 248, 0.1);
    border-color: #3d8bf8;
    color: #3d8bf8;
}

/* Highlighted state when description exists */
.stat-info-button.has-description {
    color: #3d8bf8;
    border-color: #3d8bf8;
}

/* Stat description tooltip styling */
.stat-description-tooltip {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    white-space: pre-wrap;
}

/* Modal styling for stat description editor */
.stat-description-textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Ship column header buttons container */
.ship-header-buttons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn,
.edit-config-btn,
.duplicate-config-btn,
.rename-config-btn,
.copy-config-btn,
.paste-config-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    color: var(--text-color);
}

.remove-ship-btn {
    color: #ff6b6b;
}

.remove-ship-btn:hover,
.edit-config-btn:hover,
.duplicate-config-btn:hover,
.rename-config-btn:hover,
.copy-config-btn:hover,
.paste-config-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

.config-title-grey {
    color: var(--secondary-text-color);
    font-weight: 600;
}

.config-name-highlight {
    color: #e79e00;
    font-weight: 600;
}

/* Config container and delete button */
.config-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.config-dropdown {
    flex: 1;
}

.delete-config-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-config-btn:hover {
    text-decoration: underline;
}

/* Component Attributes Panel */
.attributes-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.attributes-panel.open {
    opacity: 1;
    visibility: visible;
}

.attributes-panel-header {
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attributes-panel-title-area {
    display: flex;
    flex-direction: column;
}

.attributes-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.attributes-panel-header .category-name {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.attributes-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs for attributes panel */
.attributes-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 20px;
    background-color: var(--header-bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.attributes-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attributes-tab:hover {
    background-color: var(--button-hover-color);
}

.attributes-tab.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    font-weight: 600;
}

.attributes-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

.groups-column {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--tree-hover-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 15px;
}

.stats-column {
    flex: 1;
    overflow-y: auto;
    background-color: var(--panel-bg-color);
    padding: 20px;
}

/* Component groups list in left column */
.component-groups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-group-button {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
}

.component-group-button:hover {
    background-color: var(--button-hover-color);
}

.component-group-button.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

#attributes-container {
    padding: 20px;
    overflow-y: auto;
}

.attributes-section {
    margin-bottom: 24px;
}

.attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Style for stat labels */
.stat-editor label {
    width: 220px;
    font-size: 13px;
    color: var(--secondary-text-color);
    text-align: right;
    padding-right: 15px;
}

/* Make input fields in the attributes panel larger */
.stat-editor input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    flex: 1;
}

/* Stat input coloring for positive/negative values - MOVED HERE FOR PROPER SPECIFICITY */
.stat-editor input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-positive:focus,
.stat-editor input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stat-editor input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-negative:focus,
.stat-editor input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

.stat-editor label.stat-positive {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #4CAF50 !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

.stat-editor label.stat-negative {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #ff6b6b !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

/* TABLE LAYOUT SUPPORT - for component attributes editor table */
/* Style inputs in table cells when they have stat classes */
.stats-table input.stat-positive,
input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-positive:focus,
.stats-table input.stat-positive:hover,
input.stat-positive:focus,
input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stats-table input.stat-negative,
input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-negative:focus,
.stats-table input.stat-negative:hover,
input.stat-negative:focus,
input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

/* Color the stat names (first td) when their row contains positive/negative inputs */
.stats-table tr:has(input.stat-positive) td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr:has(input.stat-negative) td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Fallback for browsers that don't support :has() - using row classes */
.stats-table tr.stat-positive-row td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr.stat-negative-row td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Formula styling */
.scaling-formula {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.scaling-formula label {
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
}

.scaling-formula input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    width: 100%;
}

.copy-config-btn {
    color: #66bb6a;
    /* Green color for copy */
}

.paste-config-btn {
    color: #3d8bf8;
    /* Blue color for paste */
}

/* Style group layout */
.left-buttons,
.middle-buttons,
.right-buttons {
    display: flex;
    gap: 8px;
}

/* Style the actions button */
.actions-btn {
    position: relative;
}

/* Style the actions dropdown menu */
.actions-dropdown-menu {
    position: fixed;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    width: 180px;
    overflow: hidden;
    max-height: 80vh;
    overflow-y: auto;
}

.actions-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.actions-menu-item:hover {
    background-color: var(--button-hover-color);
}

/* Add icons to menu items */
.actions-menu-item::before {
    margin-right: 8px;
    font-size: 14px;
    width: 16px;
    display: inline-block;
    text-align: center;
}

.actions-menu-item[data-action="duplicate"]::before {
    content: "📋";
}

.actions-menu-item[data-action="duplicate-upgrade"]::before {
    content: "⬆️";
}

.actions-menu-item[data-action="rename"]::before {
    content: "✏️";
}

.actions-menu-item[data-action="copy"]::before {
    content: "📥";
}

.actions-menu-item[data-action="paste"]::before {
    content: "📤";
}

.actions-menu-item[data-action="delete"]::before {
    content: "🗑️";
}

.actions-menu-item[data-action="remove"]::before {
    content: "❌";
}

/* Header actions menu item icons */
.actions-menu-item[data-action="add-next-5"]::before {
    content: "➕";
}

.actions-menu-item[data-action="add-remaining"]::before {
    content: "📋";
}

.actions-menu-item[data-action="add-all"]::before {
    content: "🚀";
}

.actions-menu-item[data-action="remove-all"]::before {
    content: "🗑️";
}

/* Analysis tools menu item icons */
.actions-menu-item[data-action="config-markdown"]::before {
    content: "📄";
}

.actions-menu-item[data-action="config-name-markdown"]::before {
    content: "📝";
}

.actions-menu-item[data-action="config-uniqueness"]::before {
    content: "🔍";
}

.actions-menu-item[data-action="open-analysis-suite"]::before {
    content: "📊";
}

/* Flexbox layout for the top row with selectors and buttons */
.ship-column-header .selectors-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
}

/* Style the dropdowns */
.ship-column-header select {
    width: 100%;
    font-size: 12px;
    height: 32px;
    margin-bottom: 4px;
}

/* Container for the action buttons */
.buttons-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
}

.stat-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    /* normal order: drag left, x right */
    gap: 10px;
    height: 100%;
    margin-right: 8px;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    min-width: 32px;
    font-size: 20px;
    background: var(--tree-hover-color);
    border-radius: 6px;
    cursor: grab;
    color: var(--secondary-text-color);
    transition: background 0.2s, color 0.2s;
}

.drag-handle:hover {
    background: var(--button-hover-color);
    color: var(--text-color);
}

.delete-attribute {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    font-size: 20px;
    color: #ff6b6b;
    cursor: pointer;
    border-radius: 6px;
    background: none;
    transition: background 0.2s, color 0.2s;
}

.delete-attribute:hover {
    background: rgba(255, 107, 107, 0.08);
    color: var(--text-color);
}

/* Stats table styles for attributes panel */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background-color: var(--panel-bg-color);
}

.stats-table th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stats-table td {
    padding: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stats-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-color);
    padding-left: 8px;
    background-color: var(--button-bg-color);
}

.stats-table input {
    width: 60px;
    padding: 2px 4px;
    font-size: 11px;
    text-align: center;
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Chakra Petch', sans-serif;
}

/* === SHIP SCORING SYSTEM STYLES === */
.ship-scores-container {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    font-family: 'Chakra Petch', sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.uber-score {
    text-align: center;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.category-scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    font-size: 10px;
}

.category-score {
    text-align: center;
    padding: 3px 2px;
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === LOCKED CONFIG STYLES === */
/* Lock button styling */
.lock-button {
    font-size: 14px;
    padding: 6px 12px;
    min-width: 110px;
    background-color: #333 !important;
    transition: background-color 0.2s;
}

.lock-button:hover {
    background-color: #555 !important;
}

/* When configuration is locked */
.component-category-section.locked {
    margin-bottom: 16px;
}

/* Hide component type headers when locked */
.component-category-section.locked .component-type-header {
    display: none !important;
}

/* Make locked dropdowns have a different style */
.component-category-section.locked .component-dropdown:disabled {
    background-color: #1a1a1a;
    border-color: #333;
    color: #ffae00;
    /* Orange color for component text */
    cursor: not-allowed;
    opacity: 1;
    font-weight: 600;
}

/* Tighter spacing for locked component slots */
.component-category-section.locked .component-slot {
    margin-bottom: 1px !important;
    padding: 2px 8px !important;
}

/* When locked, hide the slot container bottom margin */
.component-category-section.locked .component-slot-container {
    margin-bottom: 0 !important;
}

/* Make locked state more visually distinct */
.components-panel.has-locked-config {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.02), transparent 100px);
}

.lock-button[title*="unlock"] {
    background-color: #444 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Category headers in locked state */
.component-category-section.locked .component-category-header {
    margin-bottom: 8px;
    font-size: 13px;
    opacity: 0.9;
}

/* Ensure dropdowns fill available space when locked */
.component-category-section.locked .component-dropdown {
    width: 100%;
    margin: 0;
}

/* Category score styling */
.category-score {
    transition: all 0.2s ease;
    cursor: help;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-score:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-score div:first-child {
    font-size: 12px;
    margin-bottom: 1px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.category-score div:last-child {
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

/* Score color transitions */
.uber-score span:first-child {
    transition: color 0.3s ease;
}

.category-score div:last-child {
    transition: color 0.3s ease;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .category-scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .category-score {
        font-size: 9px;
        min-height: 28px;
        padding: 2px 1px;
    }

    .category-score div:first-child {
        font-size: 11px;
    }

    .category-score div:last-child {
        font-size: 9px;
    }
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Config Markdown Export Modal */
#configMarkdownModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#configMarkdownModal.show {
    display: block;
}

.markdown-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 85%;
    max-width: 900px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.markdown-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in markdown modal */
.markdown-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.markdown-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.markdown-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.markdown-text ul,
.markdown-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.markdown-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.markdown-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.markdown-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Markdown table styling */
.markdown-text .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.markdown-text .markdown-table th,
.markdown-text .markdown-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-text .markdown-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text .markdown-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text .markdown-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.markdown-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.markdown-text details summary:hover {
    color: var(--accent-color);
}

.markdown-text details[open] {
    padding-bottom: 4px;
}

.markdown-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-markdown-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-markdown-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-markdown {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-markdown:hover {
    background-color: var(--accent-hover-color);
}

/* Custom ship creation modal styles */
.ship-spec-select,
.ship-manufacturer-select,
.ship-class-select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 8px;
}

.ship-spec-select:focus,
.ship-manufacturer-select:focus,
.ship-class-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(61, 139, 248, 0.1);
}

.ship-spec-select option,
.ship-manufacturer-select option,
.ship-class-select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* === THEME TOGGLE STYLES === */
/* Theme toggle styling */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg-color);
    transition: 0.3s;
    border-radius: 20px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.theme-slider {
    background-color: rgba(61, 139, 248, 0.2);
}

input:checked+.theme-slider:before {
    transform: translateX(20px);
}

/* Light theme specific adjustments */
body:not(.dark-theme) .theme-toggle label {
    border-color: #ccc;
    background-color: #f0f0f0;
}

body:not(.dark-theme) .theme-slider:before {
    background-color: #333;
}

body:not(.dark-theme) input:checked+.theme-slider:before {
    background-color: #333;
}

/* Smooth transitions for theme changes */
body {
    transition: background-color 0.3s, color 0.3s;
}

/* Update scrollbar styles for light theme */
body:not(.dark-theme) ::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Light theme specific overrides for better contrast */
body:not(.dark-theme) .ship-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .sub-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .actions-dropdown-menu {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Light theme specific fixes for better contrast */
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
    background-color: #f4f4f4 !important;
}

body:not(.dark-theme) .stats-table th {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

body:not(.dark-theme) .stats-table td {
    color: var(--text-color);
}

/* Ensure all table cells have proper text color in light mode */
body:not(.dark-theme) #ship-comparison-table td,
body:not(.dark-theme) #ship-comparison-table th {
    color: var(--text-color);
}

/* Left stat names column - use black text for better contrast in light mode */
body:not(.dark-theme) #ship-comparison-table td:first-child {
    color: #000 !important;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Keep green modified stats visible in light mode and remove bold */
body:not(.dark-theme) .stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Also ensure modified stats in light mode are green, not bold */
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Modified stats: bold and green in light mode */
body:not(.dark-theme) .stats-changed,
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: bold !important;
}

/* Left stat names: black in light mode, with high specificity */
body:not(.dark-theme) #ship-comparison-table td:first-child,
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
}

body:not(.dark-theme) .original-attribute {
    color: #000 !important;
}

.apply-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
    border-radius: 2px;
    align-self: flex-end;
}

.apply-button:hover {
    background-color: var(--accent-hover-color);
}

.groups-list-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Styling for base stats heading to match reference */
.stats-column .attributes-section h3,
.formulas-column .attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Style for base stats container - single column layout */
.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style for each stat editor row */
.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Analysis Suite Modal */
#analysisModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#analysisModal.show {
    display: block;
}

.analysis-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.analysis-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.analysis-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 10px 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
    position: relative;
    bottom: -2px;
}

.analysis-tab:hover {
    background-color: var(--button-hover-color);
}

.analysis-tab.active {
    background-color: var(--panel-bg-color);
    color: var(--accent-color);
    border-bottom: 2px solid var(--panel-bg-color);
    font-weight: 600;
}

/* Tab Content Area */
.analysis-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analysis-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in analysis modal */
.analysis-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.analysis-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.analysis-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.analysis-text ul,
.analysis-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.analysis-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.analysis-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.analysis-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Analysis table styling */
.analysis-text .analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.analysis-text .analysis-table th,
.analysis-text .analysis-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.analysis-text .analysis-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text .analysis-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text .analysis-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.analysis-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.analysis-text details summary:hover {
    color: var(--accent-color);
}

.analysis-text details[open] {
    padding-bottom: 4px;
}

.analysis-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.analysis-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.analysis-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-analysis-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-analysis-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-analysis {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-analysis:hover {
    background-color: var(--accent-hover-color);
}

/* Even more specific rules to ensure buttons align right */
#add-ship-button,
#ship-actions-button,
#analysis-tools-button {
    margin-left: 0 !important;
}

/* Force the button container to align right */
.ship-stats-header>div:last-child {
    margin-left: auto !important;
}

/* Alternative approach using flexbox on the parent */
.ship-stats-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Ensure the title doesn't take up all the space */
.ship-stats-header h2 {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Force panel controls to take remaining space and align right */
.ship-stats-header .panel-controls {
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Components Panel */
#components-panel {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#components-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.stats-column,
.components-column {
    flex: 1;
    min-width: 300px;
    display: block !important;
}

/* Pattern Builder Content */
#pattern-builder-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pattern-builder-header {
    background-color: rgba(255, 215, 0, 0.05);
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pattern-builder-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 18px;
}

.pattern-builder-header .close-button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pattern-builder-header .close-button:hover {
    color: #fff;
}

.pattern-builder-content {
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.pattern-info {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-text {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 13px;
}

.tier-one-status {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    line-height: 1.5;
}

.tier-one-status.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.tier-one-status.warning {
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.tier-one-status.error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.pattern-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pattern-control-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.pattern-control-btn:hover {
    background-color: #444;
}

.current-pattern-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
}

.pattern-name-section {
    margin-bottom: 20px;
}

.pattern-name-section label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.pattern-name-section input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

.pattern-actions-section h4,
.pattern-test-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 14px;
}

.pattern-actions-list {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.pattern-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
}

.action-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-number {
    color: #666;
    font-weight: bold;
}

.action-description {
    color: #ccc;
    font-size: 12px;
}

.action-controls {
    display: flex;
    gap: 5px;
}

.action-controls button {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.action-controls button:hover:not(:disabled) {
    background-color: #444;
}

.action-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-action-btn {
    width: 100%;
    padding: 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-action-btn:hover {
    background-color: #1976D2;
}

.pattern-test-section,
.pattern-apply-section {
    margin-top: 20px;
}

.test-config-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.test-pattern-btn {
    width: 100%;
    padding: 8px;
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.test-pattern-btn:hover {
    background-color: #7B1FA2;
}

.pattern-apply-section {
    display: flex;
    gap: 10px;
}

.apply-pattern-btn,
.apply-all-btn {
    flex: 1;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.apply-pattern-btn:hover {
    background-color: #388E3C;
}

.apply-all-btn {
    background-color: #FF9800;
}

.apply-all-btn:hover {
    background-color: #F57C00;
}

.pattern-results {
    margin-top: 20px;
    padding: 15px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

/* Action Dialog Styles */
.action-dialog {
    max-width: 600px;
}

.action-type-select {
    margin-bottom: 20px;
}

.action-type-select label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-weight: bold;
}

.action-type-select select {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
}

.action-parameters {
    margin-bottom: 20px;
}

.parameter-group {
    margin-bottom: 15px;
}

.parameter-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.parameter-group select,
.parameter-group input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.parameter-section {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.parameter-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 13px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.add-button,
.cancel-button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-button {
    background-color: #4CAF50;
    color: white;
}

.add-button:hover {
    background-color: #388E3C;
}

.cancel-button {
    background-color: #666;
    color: white;
}

.cancel-button:hover {
    background-color: #555;
}

/* Force bold text on stat value spans - overrides any inheritance issues */
.stats-changed>span,
.stats-decreased>span,
.stats-neutral>span,
td.stats-changed>span,
td.stats-decreased>span,
td.stats-neutral>span {
    font-weight: bold !important;
}

/* Configuration loading indicator styles */
.config-loading {
    position: relative;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.config-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(61, 139, 248, 0.3) 50%,
            transparent 100%);
    animation: config-loading-sweep 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes config-loading-sweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.config-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #3d8bf8;
    animation: spin 1s linear infinite;
    z-index: 10;
    text-shadow: 0 0 5px rgba(61, 139, 248, 0.5);
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ship header loading state */
.ship-header.config-loading {
    background: linear-gradient(135deg,
            rgb(20, 30, 40) 0%,
            rgb(25, 35, 45) 50%,
            rgb(20, 30, 40) 100%);
    animation: config-header-pulse 1.5s ease-in-out infinite;
    position: relative;
    z-index: 9999;
}

@keyframes config-header-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }
}

/* Disabled dropdown styling during loading */
.config-dropdown:disabled {
    cursor: wait;
    background-color: rgb(30, 30, 30);
}

/* Progress bar for ship header */
.ship-header.config-loading::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #3d8bf8;
    animation: config-progress 1.5s ease-out forwards;
    z-index: 10;
}

@keyframes config-progress {
    0% {
        width: 0%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

/* Configuration loading overlay with percentage and feed */
.config-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border: 1px solid #333;
    border-radius: 0;
    padding: 10px;
    width: 450px;
    height: 500px;
    z-index: 99999;
    box-shadow: 0 0 20px rgb(0, 0, 0);
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
}

.config-loading-percentage {
    font-size: 48px;
    font-weight: normal;
    text-align: center;
    color: #3d8bf8;
    margin-bottom: 10px;
    text-shadow: none;
    font-family: 'Courier New', monospace;
}

.percentage-value {
    display: inline-block;
    min-width: 80px;
    text-align: right;
}

.config-loading-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 5px;
    background: #0a0a0a;
    border: 1px solid #222;
    font-family: 'Courier New', monospace;
}

.feed-item {
    padding: 2px 4px;
    margin: 0;
    background: transparent;
    border-left: none;
    border-radius: 0;
    font-size: 11px;
    line-height: 1.3;
    color: #ccc;
    opacity: 1;
    animation: none;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-item.complete {
    color: #4CAF50;
}

.component-count {
    float: right;
    color: #888;
    font-size: 11px;
}

/* Terminal-style scrollbar for loading feed */
.config-loading-feed::-webkit-scrollbar {
    width: 8px;
}

.config-loading-feed::-webkit-scrollbar-track {
    background: #111;
    border-left: 1px solid #222;
}

.config-loading-feed::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 0;
}

.config-loading-feed::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Fade in animation class */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Stat filter input styling */
#stat-filter-input {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    outline: none;
    min-width: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#stat-filter-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(61, 139, 248, 0.1);
}

#stat-filter-input::placeholder {
    color: var(--secondary-text-color);
    opacity: 0.7;
}

/* Ensure the stat header has proper layout */
.stat-header>div {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.stat-header>div>span {
    flex-shrink: 0;
    font-weight: bold;
}

/* Clear button for stat filter */
.stat-filter-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
    transition: color 0.2s;
    font-weight: bold;
}

.stat-filter-clear:hover {
    color: var(--text-color);
}

.stat-filter-clear:active {
    color: #ff6b6b;
}

.ship-selector-btn {
    background-color: #222 !important;
    color: white !important;
    text-align: left !important;
    font-weight: normal !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

.ship-selector-btn:hover {
    background-color: #333 !important;
}

.ship-selector,
.config-dropdown {
    width: 100% !important;
    font-size: 14px !important;
    height: 36px !important;
    padding: 0 8px !important;
    margin: 0 !important;
}

/* This style is overridden in the inline styles */
.ship-selector {
    margin-bottom: 0 !important;
}

.sub-header {
    background-color: var(--button-bg-color);
    font-size: 11px;
    text-align: center !important;
    padding: 4px !important;
    min-width: 110px;
    color: var(--text-color);
}

.base-value,
.modified-value {
    text-align: right;
    min-width: 110px;
}

.add-ship-column {
    background-color: rgb(18, 18, 18);
    text-align: center;
    padding: 10px !important;
    border-bottom: none !important;
}

.add-ship-btn {
    font-size: 11px;
    padding: 6px 12px;
    width: auto;
}

/* Add button styling */
.add-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: var(--accent-hover-color);
}

/* Ship configs container */
.ship-configs-container {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    padding: 0;
    margin: 20px 0 0 0;
    width: 100%;
}

.ship-configs-container h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

#ship-config-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px;
    width: 100%;
}

/* Ship panel styling for configs */
.ship-config-panel {
    flex: 1 1 400px;
    min-width: 300px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
}

.ship-config-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--button-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ship-config-header h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.ship-config-content {
    padding: 12px;
}

/* Ship column in table */
.ship-column {
    min-width: 200px;
    background-color: rgb(18, 18, 18);
    border-bottom: none;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    margin-left: auto;
    align-self: flex-end;
}

.remove-ship-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

/* Split view styling */
.split-view {
    display: flex;
    gap: 15px;
    position: relative;
}

.ship-display {
    flex: 1;
    min-width: 200px;
}

.resize-handle {
    width: 8px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
    flex: 0 0 8px;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
    background-color: var(--accent-color);
}

/* Panel styling */
.panel {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg-color);
}

.panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-content {
    padding: 14px;
    height: 100%;
    overflow-y: auto;
}

/* Section styles */
.config-section,
.components-section,
.stats-section {
    margin-top: 20px;
}

.config-section h3,
.components-section h3,
.stats-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

/* Ship selector styling */
select {
    width: 100%;
    padding: 10px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    /*margin-top: 10px;*/
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
}

select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
}

/* Configuration buttons */
.config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.config-list button {
    padding: 6px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: all 0.2s;
}

.config-list button:hover {
    background-color: var(--button-hover-color);
}

.config-list button.selected {
    background-color: var(--accent-color);
    color: white;
}

/* Add configuration button */
#add-config-1,
#add-config-2 {
    padding: 8px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 13px;
    transition: all 0.2s;
}

#add-config-1:hover,
#add-config-2:hover {
    background-color: var(--button-hover-color);
}

/* Component cards */
.component-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.component-card {
    border: 2px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    background-color: var(--panel-bg-color);
    transition: all 0.2s;
    width: calc(50% - 5px);
}

.component-card.selected {
    background-color: var(--item-selected-color);
    border-color: var(--accent-color);
}

.component-card:hover {
    border-color: var(--accent-color);
}

/* Stats table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.stats-changed {
    color: #4CAF50 !important;
    /* Green for increased values */
    font-weight: bold;
    position: relative;
}

.stats-changed span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-changed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #4CAF50;
}

.stats-decreased {
    color: #ff6b6b !important;
    /* Red for decreased values */
    font-weight: bold;
    position: relative;
}

.stats-decreased span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-decreased::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ff6b6b;
}

.stats-neutral {
    color: #3d8bf8 !important;
    /* Blue for neutral modifications */
    font-weight: bold;
    position: relative;
}

.stats-neutral span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-neutral::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3d8bf8;
}

/* Component category headers */
.component-category-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    padding: 12px 16px;
    background-color: var(--header-bg-color);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

/* Style the count in category headers */
.component-category-header::after {
    content: attr(data-count);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    display: none;
}

.component-category-header[data-count]::after {
    display: block;
}

/* Style the count numbers in category headers to be orange */
.component-category-header .category-count {
    color: #ff9800;
    font-weight: 600;
}

/* Component type headers */
.component-type-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--secondary-text-color);
    margin: 15px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Component type labels */
.component-type-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 190px;
    display: inline-block;
    margin-right: 15px;
}

/* Component category sections */
.component-category-section {
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--panel-bg-color);
    overflow: hidden;
}

.component-category-section h4 {
    font-family: 'Chakra Petch', sans-serif;
    margin: 0;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--button-bg-color);
    border-bottom: 1px solid var(--border-color);
}

/* Component slots */
.component-slot {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.component-slot:last-child {
    border-bottom: none;
}

.slot-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    width: 200px;
    letter-spacing: 0.5px;
}

/* Component dropdowns */
.component-dropdown {
    flex: 1;
    padding: 8px 12px;
    background-color: rgba(255, 165, 0, 0.08);
    color: var(--text-color);
    border: 1.5px solid #e79e00;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 1px 4px 0 rgba(255, 165, 0, 0.08);
    transition: background 0.2s, border-color 0.2s;
}

.component-dropdown:focus,
.component-dropdown:hover {
    background-color: rgba(255, 165, 0, 0.16);
    border-color: #e79e00;
    outline: none;
}

.component-dropdown option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* Responsive styles */
@media (min-width: 1024px) {
    .panel {
        min-height: 700px;
    }

    .component-card {
        width: calc(33.33% - 7px);
    }
}

@media (max-width: 1023px) {
    .split-view {
        flex-direction: column;
    }

    .resize-handle {
        display: none;
    }

    .ship-display {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .component-slot {
        flex-direction: column;
        align-items: flex-start;
    }

    .slot-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .component-dropdown {
        width: 100%;
    }
}

@media (min-resolution: 1.5dppx) {
    .ship-drag-handle {
        height: 24px;
    }

    .ship-drag-handle::before {
        font-size: 24px;
    }

    .ship-header {
        padding: 12px !important;
    }

    .remove-ship-btn,
    .add-ship-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .ship-selector,
    .config-dropdown {
        padding: 8px;
        font-size: 14px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Modal dialog */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: #3d8bf8;
    font-size: 18px;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: var(--button-hover-color);
    color: var(--text-color);
}

.modal-content label {
    display: block;
    color: var(--secondary-text-color);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content select:focus {
    outline: none;
    border-color: #3d8bf8;
    box-shadow: 0 0 0 2px rgba(61, 139, 248, 0.2);
}

.modal-content input[type="text"]::placeholder {
    color: var(--secondary-text-color);
}

.add-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.add-button:hover {
    background-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(61, 139, 248, 0.3);
}

.add-button:active {
    transform: translateY(0);
}

/* Main content layout */
.main-content {
    flex: 1;
    width: 100%;
    transition: margin-right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content.panel-open {
    margin-right: 400px;
    /* Width of the components panel */
}

/* Components panel */
.components-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.components-panel.open {
    opacity: 1;
    visibility: visible;
}

.components-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

.components-panel-title-area {
    display: flex;
    flex-direction: column;
}

.components-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.components-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    letter-spacing: 0.5px;
}

.components-panel-header .config-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.components-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

/* Add styles for the components-container */
#components-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.stats-column,
.components-column {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.stats-column {
    border-right: 1px solid var(--border-color);
    padding: 0;
    margin: 0;
    height: 100%;
    overflow-y: auto;
}

.components-column {
    flex: 1;
    padding: 20px;
    padding-bottom: 50px;
    /* Extra padding at bottom for scrolling */
    overflow-y: auto;
}

/* Close button */
.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.close-button:hover {
    color: #ff6b6b;
}

/* Stats panel within components panel */
.stats-preview {
    border: 1px solid var(--border-color);
    background-color: rgba(18, 18, 18, 0.2);
    border-radius: 3px;
    margin-bottom: 20px;
}

.stats-preview h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    color: var(--secondary-text-color);
    margin: 0;
    padding: 10px 14px;
    background-color: rgba(18, 18, 18, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.stats-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.stats-preview-table th,
.stats-preview-table td {
    padding: 6px 8px;
}

.stats-preview-table th {
    background-color: rgba(18, 18, 18, 0.6);
    text-align: center;
    font-weight: 600;
}

.stats-preview-table tr:nth-child(even) {
    background-color: var(--tree-hover-color);
}

/* Stat cells styling with info button */
.stats-preview-table tbody td:first-child {
    position: relative;
    user-select: none;
}

/* Info button styling */
.stat-info-button {
    background: transparent;
    border: 1px solid #666;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.stat-info-button:hover {
    background: rgba(61, 139, 248, 0.1);
    border-color: #3d8bf8;
    color: #3d8bf8;
}

/* Highlighted state when description exists */
.stat-info-button.has-description {
    color: #3d8bf8;
    border-color: #3d8bf8;
}

/* Stat description tooltip styling */
.stat-description-tooltip {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    white-space: pre-wrap;
}

/* Modal styling for stat description editor */
.stat-description-textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Ship column header buttons container */
.ship-header-buttons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn,
.edit-config-btn,
.duplicate-config-btn,
.rename-config-btn,
.copy-config-btn,
.paste-config-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    color: var(--text-color);
}

.remove-ship-btn {
    color: #ff6b6b;
}

.remove-ship-btn:hover,
.edit-config-btn:hover,
.duplicate-config-btn:hover,
.rename-config-btn:hover,
.copy-config-btn:hover,
.paste-config-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

.config-title-grey {
    color: var(--secondary-text-color);
    font-weight: 600;
}

.config-name-highlight {
    color: #e79e00;
    font-weight: 600;
}

/* Config container and delete button */
.config-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.config-dropdown {
    flex: 1;
}

.delete-config-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-config-btn:hover {
    text-decoration: underline;
}

/* Component Attributes Panel */
.attributes-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.attributes-panel.open {
    opacity: 1;
    visibility: visible;
}

.attributes-panel-header {
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attributes-panel-title-area {
    display: flex;
    flex-direction: column;
}

.attributes-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.attributes-panel-header .category-name {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.attributes-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs for attributes panel */
.attributes-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 20px;
    background-color: var(--header-bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.attributes-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attributes-tab:hover {
    background-color: var(--button-hover-color);
}

.attributes-tab.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    font-weight: 600;
}

.attributes-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

.groups-column {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--tree-hover-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 15px;
}

.stats-column {
    flex: 1;
    overflow-y: auto;
    background-color: var(--panel-bg-color);
    padding: 20px;
}

/* Component groups list in left column */
.component-groups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-group-button {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
}

.component-group-button:hover {
    background-color: var(--button-hover-color);
}

.component-group-button.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

#attributes-container {
    padding: 20px;
    overflow-y: auto;
}

.attributes-section {
    margin-bottom: 24px;
}

.attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Style for stat labels */
.stat-editor label {
    width: 220px;
    font-size: 13px;
    color: var(--secondary-text-color);
    text-align: right;
    padding-right: 15px;
}

/* Make input fields in the attributes panel larger */
.stat-editor input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    flex: 1;
}

/* Stat input coloring for positive/negative values - MOVED HERE FOR PROPER SPECIFICITY */
.stat-editor input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-positive:focus,
.stat-editor input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stat-editor input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-negative:focus,
.stat-editor input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

.stat-editor label.stat-positive {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #4CAF50 !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

.stat-editor label.stat-negative {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #ff6b6b !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

/* TABLE LAYOUT SUPPORT - for component attributes editor table */
/* Style inputs in table cells when they have stat classes */
.stats-table input.stat-positive,
input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-positive:focus,
.stats-table input.stat-positive:hover,
input.stat-positive:focus,
input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stats-table input.stat-negative,
input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-negative:focus,
.stats-table input.stat-negative:hover,
input.stat-negative:focus,
input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

/* Color the stat names (first td) when their row contains positive/negative inputs */
.stats-table tr:has(input.stat-positive) td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr:has(input.stat-negative) td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Fallback for browsers that don't support :has() - using row classes */
.stats-table tr.stat-positive-row td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr.stat-negative-row td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Formula styling */
.scaling-formula {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.scaling-formula label {
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
}

.scaling-formula input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    width: 100%;
}

.copy-config-btn {
    color: #66bb6a;
    /* Green color for copy */
}

.paste-config-btn {
    color: #3d8bf8;
    /* Blue color for paste */
}

/* Style group layout */
.left-buttons,
.middle-buttons,
.right-buttons {
    display: flex;
    gap: 8px;
}

/* Style the actions button */
.actions-btn {
    position: relative;
}

/* Style the actions dropdown menu */
.actions-dropdown-menu {
    position: fixed;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    width: 180px;
    overflow: hidden;
    max-height: 80vh;
    overflow-y: auto;
}

.actions-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.actions-menu-item:hover {
    background-color: var(--button-hover-color);
}

/* Add icons to menu items */
.actions-menu-item::before {
    margin-right: 8px;
    font-size: 14px;
    width: 16px;
    display: inline-block;
    text-align: center;
}

.actions-menu-item[data-action="duplicate"]::before {
    content: "📋";
}

.actions-menu-item[data-action="duplicate-upgrade"]::before {
    content: "⬆️";
}

.actions-menu-item[data-action="rename"]::before {
    content: "✏️";
}

.actions-menu-item[data-action="copy"]::before {
    content: "📥";
}

.actions-menu-item[data-action="paste"]::before {
    content: "📤";
}

.actions-menu-item[data-action="delete"]::before {
    content: "🗑️";
}

.actions-menu-item[data-action="remove"]::before {
    content: "❌";
}

/* Header actions menu item icons */
.actions-menu-item[data-action="add-next-5"]::before {
    content: "➕";
}

.actions-menu-item[data-action="add-remaining"]::before {
    content: "📋";
}

.actions-menu-item[data-action="add-all"]::before {
    content: "🚀";
}

.actions-menu-item[data-action="remove-all"]::before {
    content: "🗑️";
}

/* Analysis tools menu item icons */
.actions-menu-item[data-action="config-markdown"]::before {
    content: "📄";
}

.actions-menu-item[data-action="config-name-markdown"]::before {
    content: "📝";
}

.actions-menu-item[data-action="config-uniqueness"]::before {
    content: "🔍";
}

.actions-menu-item[data-action="open-analysis-suite"]::before {
    content: "📊";
}

/* Flexbox layout for the top row with selectors and buttons */
.ship-column-header .selectors-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
}

/* Style the dropdowns */
.ship-column-header select {
    width: 100%;
    font-size: 12px;
    height: 32px;
    margin-bottom: 4px;
}

/* Container for the action buttons */
.buttons-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
}

.stat-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    /* normal order: drag left, x right */
    gap: 10px;
    height: 100%;
    margin-right: 8px;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    min-width: 32px;
    font-size: 20px;
    background: var(--tree-hover-color);
    border-radius: 6px;
    cursor: grab;
    color: var(--secondary-text-color);
    transition: background 0.2s, color 0.2s;
}

.drag-handle:hover {
    background: var(--button-hover-color);
    color: var(--text-color);
}

.delete-attribute {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    font-size: 20px;
    color: #ff6b6b;
    cursor: pointer;
    border-radius: 6px;
    background: none;
    transition: background 0.2s, color 0.2s;
}

.delete-attribute:hover {
    background: rgba(255, 107, 107, 0.08);
    color: var(--text-color);
}

/* Stats table styles for attributes panel */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background-color: var(--panel-bg-color);
}

.stats-table th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stats-table td {
    padding: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stats-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-color);
    padding-left: 8px;
    background-color: var(--button-bg-color);
}

.stats-table input {
    width: 60px;
    padding: 2px 4px;
    font-size: 11px;
    text-align: center;
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Chakra Petch', sans-serif;
}

/* === SHIP SCORING SYSTEM STYLES === */
.ship-scores-container {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    font-family: 'Chakra Petch', sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.uber-score {
    text-align: center;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.category-scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    font-size: 10px;
}

.category-score {
    text-align: center;
    padding: 3px 2px;
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === LOCKED CONFIG STYLES === */
/* Lock button styling */
.lock-button {
    font-size: 14px;
    padding: 6px 12px;
    min-width: 110px;
    background-color: #333 !important;
    transition: background-color 0.2s;
}

.lock-button:hover {
    background-color: #555 !important;
}

/* When configuration is locked */
.component-category-section.locked {
    margin-bottom: 16px;
}

/* Hide component type headers when locked */
.component-category-section.locked .component-type-header {
    display: none !important;
}

/* Make locked dropdowns have a different style */
.component-category-section.locked .component-dropdown:disabled {
    background-color: #1a1a1a;
    border-color: #333;
    color: #ffae00;
    /* Orange color for component text */
    cursor: not-allowed;
    opacity: 1;
    font-weight: 600;
}

/* Tighter spacing for locked component slots */
.component-category-section.locked .component-slot {
    margin-bottom: 1px !important;
    padding: 2px 8px !important;
}

/* When locked, hide the slot container bottom margin */
.component-category-section.locked .component-slot-container {
    margin-bottom: 0 !important;
}

/* Make locked state more visually distinct */
.components-panel.has-locked-config {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.02), transparent 100px);
}

.lock-button[title*="unlock"] {
    background-color: #444 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Category headers in locked state */
.component-category-section.locked .component-category-header {
    margin-bottom: 8px;
    font-size: 13px;
    opacity: 0.9;
}

/* Ensure dropdowns fill available space when locked */
.component-category-section.locked .component-dropdown {
    width: 100%;
    margin: 0;
}

/* Category score styling */
.category-score {
    transition: all 0.2s ease;
    cursor: help;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-score:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-score div:first-child {
    font-size: 12px;
    margin-bottom: 1px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.category-score div:last-child {
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

/* Score color transitions */
.uber-score span:first-child {
    transition: color 0.3s ease;
}

.category-score div:last-child {
    transition: color 0.3s ease;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .category-scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .category-score {
        font-size: 9px;
        min-height: 28px;
        padding: 2px 1px;
    }

    .category-score div:first-child {
        font-size: 11px;
    }

    .category-score div:last-child {
        font-size: 9px;
    }
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Config Markdown Export Modal */
#configMarkdownModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#configMarkdownModal.show {
    display: block;
}

.markdown-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 85%;
    max-width: 900px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.markdown-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in markdown modal */
.markdown-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.markdown-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.markdown-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.markdown-text ul,
.markdown-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.markdown-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.markdown-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.markdown-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Markdown table styling */
.markdown-text .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.markdown-text .markdown-table th,
.markdown-text .markdown-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-text .markdown-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text .markdown-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text .markdown-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.markdown-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.markdown-text details summary:hover {
    color: var(--accent-color);
}

.markdown-text details[open] {
    padding-bottom: 4px;
}

.markdown-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-markdown-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-markdown-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-markdown {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-markdown:hover {
    background-color: var(--accent-hover-color);
}

/* Custom ship creation modal styles */
.ship-spec-select,
.ship-manufacturer-select,
.ship-class-select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 8px;
}

.ship-spec-select:focus,
.ship-manufacturer-select:focus,
.ship-class-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(61, 139, 248, 0.1);
}

.ship-spec-select option,
.ship-manufacturer-select option,
.ship-class-select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* === THEME TOGGLE STYLES === */
/* Theme toggle styling */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg-color);
    transition: 0.3s;
    border-radius: 20px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.theme-slider {
    background-color: rgba(61, 139, 248, 0.2);
}

input:checked+.theme-slider:before {
    transform: translateX(20px);
}

/* Light theme specific adjustments */
body:not(.dark-theme) .theme-toggle label {
    border-color: #ccc;
    background-color: #f0f0f0;
}

body:not(.dark-theme) .theme-slider:before {
    background-color: #333;
}

body:not(.dark-theme) input:checked+.theme-slider:before {
    background-color: #333;
}

/* Smooth transitions for theme changes */
body {
    transition: background-color 0.3s, color 0.3s;
}

/* Update scrollbar styles for light theme */
body:not(.dark-theme) ::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Light theme specific overrides for better contrast */
body:not(.dark-theme) .ship-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .sub-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .actions-dropdown-menu {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Light theme specific fixes for better contrast */
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
    background-color: #f4f4f4 !important;
}

body:not(.dark-theme) .stats-table th {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

body:not(.dark-theme) .stats-table td {
    color: var(--text-color);
}

/* Ensure all table cells have proper text color in light mode */
body:not(.dark-theme) #ship-comparison-table td,
body:not(.dark-theme) #ship-comparison-table th {
    color: var(--text-color);
}

/* Left stat names column - use black text for better contrast in light mode */
body:not(.dark-theme) #ship-comparison-table td:first-child {
    color: #000 !important;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Keep green modified stats visible in light mode and remove bold */
body:not(.dark-theme) .stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Also ensure modified stats in light mode are green, not bold */
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Modified stats: bold and green in light mode */
body:not(.dark-theme) .stats-changed,
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: bold !important;
}

/* Left stat names: black in light mode, with high specificity */
body:not(.dark-theme) #ship-comparison-table td:first-child,
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
}

body:not(.dark-theme) .original-attribute {
    color: #000 !important;
}

.apply-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
    border-radius: 2px;
    align-self: flex-end;
}

.apply-button:hover {
    background-color: var(--accent-hover-color);
}

.groups-list-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Styling for base stats heading to match reference */
.stats-column .attributes-section h3,
.formulas-column .attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Style for base stats container - single column layout */
.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style for each stat editor row */
.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Analysis Suite Modal */
#analysisModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#analysisModal.show {
    display: block;
}

.analysis-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.analysis-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.analysis-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 10px 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
    position: relative;
    bottom: -2px;
}

.analysis-tab:hover {
    background-color: var(--button-hover-color);
}

.analysis-tab.active {
    background-color: var(--panel-bg-color);
    color: var(--accent-color);
    border-bottom: 2px solid var(--panel-bg-color);
    font-weight: 600;
}

/* Tab Content Area */
.analysis-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analysis-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in analysis modal */
.analysis-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.analysis-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.analysis-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.analysis-text ul,
.analysis-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.analysis-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.analysis-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.analysis-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Analysis table styling */
.analysis-text .analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.analysis-text .analysis-table th,
.analysis-text .analysis-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.analysis-text .analysis-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text .analysis-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text .analysis-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.analysis-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.analysis-text details summary:hover {
    color: var(--accent-color);
}

.analysis-text details[open] {
    padding-bottom: 4px;
}

.analysis-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.analysis-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.analysis-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-analysis-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-analysis-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-analysis {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-analysis:hover {
    background-color: var(--accent-hover-color);
}

/* Even more specific rules to ensure buttons align right */
#add-ship-button,
#ship-actions-button,
#analysis-tools-button {
    margin-left: 0 !important;
}

/* Force the button container to align right */
.ship-stats-header>div:last-child {
    margin-left: auto !important;
}

/* Alternative approach using flexbox on the parent */
.ship-stats-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Ensure the title doesn't take up all the space */
.ship-stats-header h2 {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Force panel controls to take remaining space and align right */
.ship-stats-header .panel-controls {
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Components Panel */
#components-panel {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#components-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.stats-column,
.components-column {
    flex: 1;
    min-width: 300px;
    display: block !important;
}

/* Pattern Builder Content */
#pattern-builder-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pattern-builder-header {
    background-color: rgba(255, 215, 0, 0.05);
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pattern-builder-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 18px;
}

.pattern-builder-header .close-button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pattern-builder-header .close-button:hover {
    color: #fff;
}

.pattern-builder-content {
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.pattern-info {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-text {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 13px;
}

.tier-one-status {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    line-height: 1.5;
}

.tier-one-status.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.tier-one-status.warning {
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.tier-one-status.error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.pattern-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pattern-control-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.pattern-control-btn:hover {
    background-color: #444;
}

.current-pattern-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
}

.pattern-name-section {
    margin-bottom: 20px;
}

.pattern-name-section label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.pattern-name-section input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

.pattern-actions-section h4,
.pattern-test-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 14px;
}

.pattern-actions-list {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.pattern-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
}

.action-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-number {
    color: #666;
    font-weight: bold;
}

.action-description {
    color: #ccc;
    font-size: 12px;
}

.action-controls {
    display: flex;
    gap: 5px;
}

.action-controls button {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.action-controls button:hover:not(:disabled) {
    background-color: #444;
}

.action-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-action-btn {
    width: 100%;
    padding: 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-action-btn:hover {
    background-color: #1976D2;
}

.pattern-test-section,
.pattern-apply-section {
    margin-top: 20px;
}

.test-config-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.test-pattern-btn {
    width: 100%;
    padding: 8px;
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.test-pattern-btn:hover {
    background-color: #7B1FA2;
}

.pattern-apply-section {
    display: flex;
    gap: 10px;
}

.apply-pattern-btn,
.apply-all-btn {
    flex: 1;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.apply-pattern-btn:hover {
    background-color: #388E3C;
}

.apply-all-btn {
    background-color: #FF9800;
}

.apply-all-btn:hover {
    background-color: #F57C00;
}

.pattern-results {
    margin-top: 20px;
    padding: 15px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

/* Action Dialog Styles */
.action-dialog {
    max-width: 600px;
}

.action-type-select {
    margin-bottom: 20px;
}

.action-type-select label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-weight: bold;
}

.action-type-select select {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
}

.action-parameters {
    margin-bottom: 20px;
}

.parameter-group {
    margin-bottom: 15px;
}

.parameter-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.parameter-group select,
.parameter-group input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.parameter-section {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.parameter-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 13px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.add-button,
.cancel-button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-button {
    background-color: #4CAF50;
    color: white;
}

.add-button:hover {
    background-color: #388E3C;
}

.cancel-button {
    background-color: #666;
    color: white;
}

.cancel-button:hover {
    background-color: #555;
}

/* Force bold text on stat value spans - overrides any inheritance issues */
.stats-changed>span,
.stats-decreased>span,
.stats-neutral>span,
td.stats-changed>span,
td.stats-decreased>span,
td.stats-neutral>span {
    font-weight: bold !important;
}

/* Configuration loading indicator styles */
.config-loading {
    position: relative;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.config-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(61, 139, 248, 0.3) 50%,
            transparent 100%);
    animation: config-loading-sweep 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes config-loading-sweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.config-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #3d8bf8;
    animation: spin 1s linear infinite;
    z-index: 10;
    text-shadow: 0 0 5px rgba(61, 139, 248, 0.5);
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ship header loading state */
.ship-header.config-loading {
    background: linear-gradient(135deg,
            rgb(20, 30, 40) 0%,
            rgb(25, 35, 45) 50%,
            rgb(20, 30, 40) 100%);
    animation: config-header-pulse 1.5s ease-in-out infinite;
    position: relative;
    z-index: 9999;
}

@keyframes config-header-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }
}

/* Disabled dropdown styling during loading */
.config-dropdown:disabled {
    cursor: wait;
    background-color: rgb(30, 30, 30);
}

/* Progress bar for ship header */
.ship-header.config-loading::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #3d8bf8;
    animation: config-progress 1.5s ease-out forwards;
    z-index: 10;
}

@keyframes config-progress {
    0% {
        width: 0%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

/* Configuration loading overlay with percentage and feed */
.config-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border: 1px solid #333;
    border-radius: 0;
    padding: 10px;
    width: 450px;
    height: 500px;
    z-index: 99999;
    box-shadow: 0 0 20px rgb(0, 0, 0);
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
}

.config-loading-percentage {
    font-size: 48px;
    font-weight: normal;
    text-align: center;
    color: #3d8bf8;
    margin-bottom: 10px;
    text-shadow: none;
    font-family: 'Courier New', monospace;
}

.percentage-value {
    display: inline-block;
    min-width: 80px;
    text-align: right;
}

.config-loading-feed {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 5px;
    background: #0a0a0a;
    border: 1px solid #222;
    font-family: 'Courier New', monospace;
}

.feed-item {
    padding: 2px 4px;
    margin: 0;
    background: transparent;
    border-left: none;
    border-radius: 0;
    font-size: 11px;
    line-height: 1.3;
    color: #ccc;
    opacity: 1;
    animation: none;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-item.complete {
    color: #4CAF50;
}

.component-count {
    float: right;
    color: #888;
    font-size: 11px;
}

/* Terminal-style scrollbar for loading feed */
.config-loading-feed::-webkit-scrollbar {
    width: 8px;
}

.config-loading-feed::-webkit-scrollbar-track {
    background: #111;
    border-left: 1px solid #222;
}

.config-loading-feed::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 0;
}

.config-loading-feed::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Fade in animation class */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Stat filter input styling */
#stat-filter-input {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    outline: none;
    min-width: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#stat-filter-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(61, 139, 248, 0.1);
}

#stat-filter-input::placeholder {
    color: var(--secondary-text-color);
    opacity: 0.7;
}

/* Ensure the stat header has proper layout */
.stat-header>div {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.stat-header>div>span {
    flex-shrink: 0;
    font-weight: bold;
}

/* Clear button for stat filter */
.stat-filter-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
    transition: color 0.2s;
    font-weight: bold;
}

.stat-filter-clear:hover {
    color: var(--text-color);
}

.stat-filter-clear:active {
    color: #ff6b6b;
}

.ship-selector-btn {
    background-color: #222 !important;
    color: white !important;
    text-align: left !important;
    font-weight: normal !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

.ship-selector-btn:hover {
    background-color: #333 !important;
}

.ship-selector,
.config-dropdown {
    width: 100% !important;
    font-size: 14px !important;
    height: 36px !important;
    padding: 0 8px !important;
    margin: 0 !important;
}

/* This style is overridden in the inline styles */
.ship-selector {
    margin-bottom: 0 !important;
}

.sub-header {
    background-color: var(--button-bg-color);
    font-size: 11px;
    text-align: center !important;
    padding: 4px !important;
    min-width: 110px;
    color: var(--text-color);
}

.base-value,
.modified-value {
    text-align: right;
    min-width: 110px;
}

.add-ship-column {
    background-color: rgb(18, 18, 18);
    text-align: center;
    padding: 10px !important;
    border-bottom: none !important;
}

.add-ship-btn {
    font-size: 11px;
    padding: 6px 12px;
    width: auto;
}

/* Add button styling */
.add-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-button:hover {
    background-color: var(--accent-hover-color);
}

/* Ship configs container */
.ship-configs-container {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    padding: 0;
    margin: 20px 0 0 0;
    width: 100%;
}

.ship-configs-container h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

#ship-config-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px;
    width: 100%;
}

/* Ship panel styling for configs */
.ship-config-panel {
    flex: 1 1 400px;
    min-width: 300px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
}

.ship-config-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--button-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ship-config-header h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.ship-config-content {
    padding: 12px;
}

/* Ship column in table */
.ship-column {
    min-width: 200px;
    background-color: rgb(18, 18, 18);
    border-bottom: none;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    margin-left: auto;
    align-self: flex-end;
}

.remove-ship-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

/* Split view styling */
.split-view {
    display: flex;
    gap: 15px;
    position: relative;
}

.ship-display {
    flex: 1;
    min-width: 200px;
}

.resize-handle {
    width: 8px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
    flex: 0 0 8px;
    z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
    background-color: var(--accent-color);
}

/* Panel styling */
.panel {
    background-color: var(--panel-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg-color);
}

.panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-content {
    padding: 14px;
    height: 100%;
    overflow-y: auto;
}

/* Section styles */
.config-section,
.components-section,
.stats-section {
    margin-top: 20px;
}

.config-section h3,
.components-section h3,
.stats-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

/* Ship selector styling */
select {
    width: 100%;
    padding: 10px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    /*margin-top: 10px;*/
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
}

select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
}

/* Configuration buttons */
.config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.config-list button {
    padding: 6px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 12px;
    transition: all 0.2s;
}

.config-list button:hover {
    background-color: var(--button-hover-color);
}

.config-list button.selected {
    background-color: var(--accent-color);
    color: white;
}

/* Add configuration button */
#add-config-1,
#add-config-2 {
    padding: 8px 12px;
    background-color: var(--button-bg-color);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.5px;
    font-size: 13px;
    transition: all 0.2s;
}

#add-config-1:hover,
#add-config-2:hover {
    background-color: var(--button-hover-color);
}

/* Component cards */
.component-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.component-card {
    border: 2px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    background-color: var(--panel-bg-color);
    transition: all 0.2s;
    width: calc(50% - 5px);
}

.component-card.selected {
    background-color: var(--item-selected-color);
    border-color: var(--accent-color);
}

.component-card:hover {
    border-color: var(--accent-color);
}

/* Stats table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.stats-changed {
    color: #4CAF50 !important;
    /* Green for increased values */
    font-weight: bold;
    position: relative;
}

.stats-changed span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-changed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #4CAF50;
}

.stats-decreased {
    color: #ff6b6b !important;
    /* Red for decreased values */
    font-weight: bold;
    position: relative;
}

.stats-decreased span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-decreased::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ff6b6b;
}

.stats-neutral {
    color: #3d8bf8 !important;
    /* Blue for neutral modifications */
    font-weight: bold;
    position: relative;
}

.stats-neutral span {
    color: inherit !important;
    font-weight: inherit !important;
}

.stats-neutral::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #3d8bf8;
}

/* Component category headers */
.component-category-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    padding: 12px 16px;
    background-color: var(--header-bg-color);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

/* Style the count in category headers */
.component-category-header::after {
    content: attr(data-count);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    display: none;
}

.component-category-header[data-count]::after {
    display: block;
}

/* Style the count numbers in category headers to be orange */
.component-category-header .category-count {
    color: #ff9800;
    font-weight: 600;
}

/* Component type headers */
.component-type-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--secondary-text-color);
    margin: 15px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Component type labels */
.component-type-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 190px;
    display: inline-block;
    margin-right: 15px;
}

/* Component category sections */
.component-category-section {
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--panel-bg-color);
    overflow: hidden;
}

.component-category-section h4 {
    font-family: 'Chakra Petch', sans-serif;
    margin: 0;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--button-bg-color);
    border-bottom: 1px solid var(--border-color);
}

/* Component slots */
.component-slot {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.component-slot:last-child {
    border-bottom: none;
}

.slot-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    width: 200px;
    letter-spacing: 0.5px;
}

/* Component dropdowns */
.component-dropdown {
    flex: 1;
    padding: 8px 12px;
    background-color: rgba(255, 165, 0, 0.08);
    color: var(--text-color);
    border: 1.5px solid #e79e00;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 1px 4px 0 rgba(255, 165, 0, 0.08);
    transition: background 0.2s, border-color 0.2s;
}

.component-dropdown:focus,
.component-dropdown:hover {
    background-color: rgba(255, 165, 0, 0.16);
    border-color: #e79e00;
    outline: none;
}

.component-dropdown option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* Responsive styles */
@media (min-width: 1024px) {
    .panel {
        min-height: 700px;
    }

    .component-card {
        width: calc(33.33% - 7px);
    }
}

@media (max-width: 1023px) {
    .split-view {
        flex-direction: column;
    }

    .resize-handle {
        display: none;
    }

    .ship-display {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .component-slot {
        flex-direction: column;
        align-items: flex-start;
    }

    .slot-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .component-dropdown {
        width: 100%;
    }
}

@media (min-resolution: 1.5dppx) {
    .ship-drag-handle {
        height: 24px;
    }

    .ship-drag-handle::before {
        font-size: 24px;
    }

    .ship-header {
        padding: 12px !important;
    }

    .remove-ship-btn,
    .add-ship-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .ship-selector,
    .config-dropdown {
        padding: 8px;
        font-size: 14px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Modal dialog */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    color: var(--text-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: #3d8bf8;
    font-size: 18px;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: var(--button-hover-color);
    color: var(--text-color);
}

.modal-content label {
    display: block;
    color: var(--secondary-text-color);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content select:focus {
    outline: none;
    border-color: #3d8bf8;
    box-shadow: 0 0 0 2px rgba(61, 139, 248, 0.2);
}

.modal-content input[type="text"]::placeholder {
    color: var(--secondary-text-color);
}

.add-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
}

.add-button:hover {
    background-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(61, 139, 248, 0.3);
}

.add-button:active {
    transform: translateY(0);
}

/* Main content layout */
.main-content {
    flex: 1;
    width: 100%;
    transition: margin-right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content.panel-open {
    margin-right: 400px;
    /* Width of the components panel */
}

/* Components panel */
.components-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.components-panel.open {
    opacity: 1;
    visibility: visible;
}

.components-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
}

.components-panel-title-area {
    display: flex;
    flex-direction: column;
}

.components-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.components-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-text-color);
    letter-spacing: 0.5px;
}

.components-panel-header .config-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.components-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

/* Add styles for the components-container */
#components-container {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.stats-column,
.components-column {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.stats-column {
    border-right: 1px solid var(--border-color);
    padding: 0;
    margin: 0;
    height: 100%;
    overflow-y: auto;
}

.components-column {
    flex: 1;
    padding: 20px;
    padding-bottom: 50px;
    /* Extra padding at bottom for scrolling */
    overflow-y: auto;
}

/* Close button */
.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.close-button:hover {
    color: #ff6b6b;
}

/* Stats panel within components panel */
.stats-preview {
    border: 1px solid var(--border-color);
    background-color: rgba(18, 18, 18, 0.2);
    border-radius: 3px;
    margin-bottom: 20px;
}

.stats-preview h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    color: var(--secondary-text-color);
    margin: 0;
    padding: 10px 14px;
    background-color: rgba(18, 18, 18, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.stats-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.stats-preview-table th,
.stats-preview-table td {
    padding: 6px 8px;
}

.stats-preview-table th {
    background-color: rgba(18, 18, 18, 0.6);
    text-align: center;
    font-weight: 600;
}

.stats-preview-table tr:nth-child(even) {
    background-color: var(--tree-hover-color);
}

/* Stat cells styling with info button */
.stats-preview-table tbody td:first-child {
    position: relative;
    user-select: none;
}

/* Info button styling */
.stat-info-button {
    background: transparent;
    border: 1px solid #666;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.stat-info-button:hover {
    background: rgba(61, 139, 248, 0.1);
    border-color: #3d8bf8;
    color: #3d8bf8;
}

/* Highlighted state when description exists */
.stat-info-button.has-description {
    color: #3d8bf8;
    border-color: #3d8bf8;
}

/* Stat description tooltip styling */
.stat-description-tooltip {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    white-space: pre-wrap;
}

/* Modal styling for stat description editor */
.stat-description-textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Ship column header buttons container */
.ship-header-buttons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.ship-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-ship-btn,
.edit-config-btn,
.duplicate-config-btn,
.rename-config-btn,
.copy-config-btn,
.paste-config-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    color: var(--text-color);
}

.remove-ship-btn {
    color: #ff6b6b;
}

.remove-ship-btn:hover,
.edit-config-btn:hover,
.duplicate-config-btn:hover,
.rename-config-btn:hover,
.copy-config-btn:hover,
.paste-config-btn:hover {
    text-decoration: underline;
}

.base-header,
.modified-header {
    background-color: var(--button-bg-color);
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    min-width: 100px;
    color: var(--text-color);
}

.config-title-grey {
    color: var(--secondary-text-color);
    font-weight: 600;
}

.config-name-highlight {
    color: #e79e00;
    font-weight: 600;
}

/* Config container and delete button */
.config-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.config-dropdown {
    flex: 1;
}

.delete-config-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-config-btn:hover {
    text-decoration: underline;
}

/* Component Attributes Panel */
.attributes-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--panel-bg-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.attributes-panel.open {
    opacity: 1;
    visibility: visible;
}

.attributes-panel-header {
    padding: 4px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attributes-panel-title-area {
    display: flex;
    flex-direction: column;
}

.attributes-panel-header h2 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.attributes-panel-header .category-name {
    font-size: 12px;
    color: var(--secondary-text-color);
    margin-top: 4px;
}

.attributes-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs for attributes panel */
.attributes-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 20px;
    background-color: var(--header-bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.attributes-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attributes-tab:hover {
    background-color: var(--button-hover-color);
}

.attributes-tab.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    font-weight: 600;
}

.attributes-panel-content {
    padding: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
}

.groups-column {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--tree-hover-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 15px;
}

.stats-column {
    flex: 1;
    overflow-y: auto;
    background-color: var(--panel-bg-color);
    padding: 20px;
}

/* Component groups list in left column */
.component-groups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.component-group-button {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
}

.component-group-button:hover {
    background-color: var(--button-hover-color);
}

.component-group-button.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

#attributes-container {
    padding: 20px;
    overflow-y: auto;
}

.attributes-section {
    margin-bottom: 24px;
}

.attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Style for stat labels */
.stat-editor label {
    width: 220px;
    font-size: 13px;
    color: var(--secondary-text-color);
    text-align: right;
    padding-right: 15px;
}

/* Make input fields in the attributes panel larger */
.stat-editor input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    flex: 1;
}

/* Stat input coloring for positive/negative values - MOVED HERE FOR PROPER SPECIFICITY */
.stat-editor input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-positive:focus,
.stat-editor input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stat-editor input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12);
    transition: background 0.2s, border-color 0.2s;
    border-radius: 0 4px 4px 0 !important;
}

.stat-editor input.stat-negative:focus,
.stat-editor input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

.stat-editor label.stat-positive {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #4CAF50 !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

.stat-editor label.stat-negative {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.12) !important;
    padding: 8px 15px !important;
    border-radius: 4px 0 0 4px !important;
    border: 1.5px solid #ff6b6b !important;
    border-right: none !important;
    width: 220px !important;
    text-align: right !important;
}

/* TABLE LAYOUT SUPPORT - for component attributes editor table */
/* Style inputs in table cells when they have stat classes */
.stats-table input.stat-positive,
input.stat-positive {
    background-color: rgba(76, 175, 80, 0.12) !important;
    border: 1.5px solid #4CAF50 !important;
    color: #4CAF50 !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(76, 175, 80, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-positive:focus,
.stats-table input.stat-positive:hover,
input.stat-positive:focus,
input.stat-positive:hover {
    background-color: rgba(76, 175, 80, 0.20) !important;
    border-color: #4CAF50 !important;
    outline: none;
}

.stats-table input.stat-negative,
input.stat-negative {
    background-color: rgba(255, 107, 107, 0.12) !important;
    border: 1.5px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
    box-shadow: 0 1px 4px 0 rgba(255, 107, 107, 0.12) !important;
    transition: background 0.2s, border-color 0.2s;
}

.stats-table input.stat-negative:focus,
.stats-table input.stat-negative:hover,
input.stat-negative:focus,
input.stat-negative:hover {
    background-color: rgba(255, 107, 107, 0.20) !important;
    border-color: #ff6b6b !important;
    outline: none;
}

/* Color the stat names (first td) when their row contains positive/negative inputs */
.stats-table tr:has(input.stat-positive) td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr:has(input.stat-negative) td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Fallback for browsers that don't support :has() - using row classes */
.stats-table tr.stat-positive-row td:first-child {
    color: #4CAF50 !important;
    font-weight: bold !important;
    background-color: rgba(76, 175, 80, 0.08) !important;
}

.stats-table tr.stat-negative-row td:first-child {
    color: #ff6b6b !important;
    font-weight: bold !important;
    background-color: rgba(255, 107, 107, 0.08) !important;
}

/* Formula styling */
.scaling-formula {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.scaling-formula label {
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-bottom: 8px;
}

.scaling-formula input {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Chakra Petch', sans-serif;
    width: 100%;
}

.copy-config-btn {
    color: #66bb6a;
    /* Green color for copy */
}

.paste-config-btn {
    color: #3d8bf8;
    /* Blue color for paste */
}

/* Style group layout */
.left-buttons,
.middle-buttons,
.right-buttons {
    display: flex;
    gap: 8px;
}

/* Style the actions button */
.actions-btn {
    position: relative;
}

/* Style the actions dropdown menu */
.actions-dropdown-menu {
    position: fixed;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    width: 180px;
    overflow: hidden;
    max-height: 80vh;
    overflow-y: auto;
}

.actions-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.actions-menu-item:hover {
    background-color: var(--button-hover-color);
}

/* Add icons to menu items */
.actions-menu-item::before {
    margin-right: 8px;
    font-size: 14px;
    width: 16px;
    display: inline-block;
    text-align: center;
}

.actions-menu-item[data-action="duplicate"]::before {
    content: "📋";
}

.actions-menu-item[data-action="duplicate-upgrade"]::before {
    content: "⬆️";
}

.actions-menu-item[data-action="rename"]::before {
    content: "✏️";
}

.actions-menu-item[data-action="copy"]::before {
    content: "📥";
}

.actions-menu-item[data-action="paste"]::before {
    content: "📤";
}

.actions-menu-item[data-action="delete"]::before {
    content: "🗑️";
}

.actions-menu-item[data-action="remove"]::before {
    content: "❌";
}

/* Header actions menu item icons */
.actions-menu-item[data-action="add-next-5"]::before {
    content: "➕";
}

.actions-menu-item[data-action="add-remaining"]::before {
    content: "📋";
}

.actions-menu-item[data-action="add-all"]::before {
    content: "🚀";
}

.actions-menu-item[data-action="remove-all"]::before {
    content: "🗑️";
}

/* Analysis tools menu item icons */
.actions-menu-item[data-action="config-markdown"]::before {
    content: "📄";
}

.actions-menu-item[data-action="config-name-markdown"]::before {
    content: "📝";
}

.actions-menu-item[data-action="config-uniqueness"]::before {
    content: "🔍";
}

.actions-menu-item[data-action="open-analysis-suite"]::before {
    content: "📊";
}

/* Flexbox layout for the top row with selectors and buttons */
.ship-column-header .selectors-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
}

/* Style the dropdowns */
.ship-column-header select {
    width: 100%;
    font-size: 12px;
    height: 32px;
    margin-bottom: 4px;
}

/* Container for the action buttons */
.buttons-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
}

.stat-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    /* normal order: drag left, x right */
    gap: 10px;
    height: 100%;
    margin-right: 8px;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    min-width: 32px;
    font-size: 20px;
    background: var(--tree-hover-color);
    border-radius: 6px;
    cursor: grab;
    color: var(--secondary-text-color);
    transition: background 0.2s, color 0.2s;
}

.drag-handle:hover {
    background: var(--button-hover-color);
    color: var(--text-color);
}

.delete-attribute {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 32px;
    font-size: 20px;
    color: #ff6b6b;
    cursor: pointer;
    border-radius: 6px;
    background: none;
    transition: background 0.2s, color 0.2s;
}

.delete-attribute:hover {
    background: rgba(255, 107, 107, 0.08);
    color: var(--text-color);
}

/* Stats table styles for attributes panel */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background-color: var(--panel-bg-color);
}

.stats-table th {
    background-color: var(--header-bg-color);
    color: var(--secondary-text-color);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stats-table td {
    padding: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stats-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-color);
    padding-left: 8px;
    background-color: var(--button-bg-color);
}

.stats-table input {
    width: 60px;
    padding: 2px 4px;
    font-size: 11px;
    text-align: center;
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Chakra Petch', sans-serif;
}

/* === SHIP SCORING SYSTEM STYLES === */
.ship-scores-container {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    font-family: 'Chakra Petch', sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.uber-score {
    text-align: center;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.category-scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    font-size: 10px;
}

.category-score {
    text-align: center;
    padding: 3px 2px;
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* === LOCKED CONFIG STYLES === */
/* Lock button styling */
.lock-button {
    font-size: 14px;
    padding: 6px 12px;
    min-width: 110px;
    background-color: #333 !important;
    transition: background-color 0.2s;
}

.lock-button:hover {
    background-color: #555 !important;
}

/* When configuration is locked */
.component-category-section.locked {
    margin-bottom: 16px;
}

/* Hide component type headers when locked */
.component-category-section.locked .component-type-header {
    display: none !important;
}

/* Make locked dropdowns have a different style */
.component-category-section.locked .component-dropdown:disabled {
    background-color: #1a1a1a;
    border-color: #333;
    color: #ffae00;
    /* Orange color for component text */
    cursor: not-allowed;
    opacity: 1;
    font-weight: 600;
}

/* Tighter spacing for locked component slots */
.component-category-section.locked .component-slot {
    margin-bottom: 1px !important;
    padding: 2px 8px !important;
}

/* When locked, hide the slot container bottom margin */
.component-category-section.locked .component-slot-container {
    margin-bottom: 0 !important;
}

/* Make locked state more visually distinct */
.components-panel.has-locked-config {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.02), transparent 100px);
}

.lock-button[title*="unlock"] {
    background-color: #444 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Category headers in locked state */
.component-category-section.locked .component-category-header {
    margin-bottom: 8px;
    font-size: 13px;
    opacity: 0.9;
}

/* Ensure dropdowns fill available space when locked */
.component-category-section.locked .component-dropdown {
    width: 100%;
    margin: 0;
}

/* Category score styling */
.category-score {
    transition: all 0.2s ease;
    cursor: help;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-score:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-score div:first-child {
    font-size: 12px;
    margin-bottom: 1px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

.category-score div:last-child {
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

/* Score color transitions */
.uber-score span:first-child {
    transition: color 0.3s ease;
}

.category-score div:last-child {
    transition: color 0.3s ease;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .category-scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .category-score {
        font-size: 9px;
        min-height: 28px;
        padding: 2px 1px;
    }

    .category-score div:first-child {
        font-size: 11px;
    }

    .category-score div:last-child {
        font-size: 9px;
    }
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Config Markdown Export Modal */
#configMarkdownModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#configMarkdownModal.show {
    display: block;
}

.markdown-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 85%;
    max-width: 900px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.markdown-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in markdown modal */
.markdown-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.markdown-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.markdown-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.markdown-text ul,
.markdown-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.markdown-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.markdown-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.markdown-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Markdown table styling */
.markdown-text .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.markdown-text .markdown-table th,
.markdown-text .markdown-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-text .markdown-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.markdown-text .markdown-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text .markdown-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.markdown-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.markdown-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.markdown-text details summary:hover {
    color: var(--accent-color);
}

.markdown-text details[open] {
    padding-bottom: 4px;
}

.markdown-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-markdown-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-markdown-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-markdown {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-markdown:hover {
    background-color: var(--accent-hover-color);
}

/* Custom ship creation modal styles */
.ship-spec-select,
.ship-manufacturer-select,
.ship-class-select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 8px;
}

.ship-spec-select:focus,
.ship-manufacturer-select:focus,
.ship-class-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(61, 139, 248, 0.1);
}

.ship-spec-select option,
.ship-manufacturer-select option,
.ship-class-select option {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
    padding: 6px;
}

/* === THEME TOGGLE STYLES === */
/* Theme toggle styling */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-toggle label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg-color);
    transition: 0.3s;
    border-radius: 20px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.theme-slider {
    background-color: rgba(61, 139, 248, 0.2);
}

input:checked+.theme-slider:before {
    transform: translateX(20px);
}

/* Light theme specific adjustments */
body:not(.dark-theme) .theme-toggle label {
    border-color: #ccc;
    background-color: #f0f0f0;
}

body:not(.dark-theme) .theme-slider:before {
    background-color: #333;
}

body:not(.dark-theme) input:checked+.theme-slider:before {
    background-color: #333;
}

/* Smooth transitions for theme changes */
body {
    transition: background-color 0.3s, color 0.3s;
}

/* Update scrollbar styles for light theme */
body:not(.dark-theme) ::-webkit-scrollbar-track {
    background: var(--scroll-track-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb-color);
}

body:not(.dark-theme) ::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Light theme specific overrides for better contrast */
body:not(.dark-theme) .ship-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .sub-header {
    border: 1px solid var(--border-color);
}

body:not(.dark-theme) .actions-dropdown-menu {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Light theme specific fixes for better contrast */
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
    background-color: #f4f4f4 !important;
}

body:not(.dark-theme) .stats-table th {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

body:not(.dark-theme) .stats-table td {
    color: var(--text-color);
}

/* Ensure all table cells have proper text color in light mode */
body:not(.dark-theme) #ship-comparison-table td,
body:not(.dark-theme) #ship-comparison-table th {
    color: var(--text-color);
}

/* Left stat names column - use black text for better contrast in light mode */
body:not(.dark-theme) #ship-comparison-table td:first-child {
    color: #000 !important;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Keep green modified stats visible in light mode and remove bold */
body:not(.dark-theme) .stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Also ensure modified stats in light mode are green, not bold */
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: normal !important;
}

/* Modified stats: bold and green in light mode */
body:not(.dark-theme) .stats-changed,
body:not(.dark-theme) .modified-value.stats-changed {
    color: #4CAF50 !important;
    font-weight: bold !important;
}

/* Left stat names: black in light mode, with high specificity */
body:not(.dark-theme) #ship-comparison-table td:first-child,
body:not(.dark-theme) .stats-table td:first-child {
    color: #000 !important;
}

body:not(.dark-theme) .original-attribute {
    color: #000 !important;
}

.apply-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 14px;
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
    border-radius: 2px;
    align-self: flex-end;
}

.apply-button:hover {
    background-color: var(--accent-hover-color);
}

.groups-list-header {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Styling for base stats heading to match reference */
.stats-column .attributes-section h3,
.formulas-column .attributes-section h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Style for base stats container - single column layout */
.stats-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style for each stat editor row */
.stat-editor {
    display: flex;
    align-items: center;
    width: 100%;
}

.markdown-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.markdown-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.markdown-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* === END SHIP SCORING SYSTEM STYLES === */

/* Ship Analysis Suite Modal */
#analysisModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    padding: 20px 0;
}

#analysisModal.show {
    display: block;
}

.analysis-modal-content {
    background-color: var(--panel-bg-color);
    border-radius: 8px;
    margin: 20px auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.analysis-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.analysis-tab {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 10px 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
    position: relative;
    bottom: -2px;
}

.analysis-tab:hover {
    background-color: var(--button-hover-color);
}

.analysis-tab.active {
    background-color: var(--panel-bg-color);
    color: var(--accent-color);
    border-bottom: 2px solid var(--panel-bg-color);
    font-weight: 600;
}

/* Tab Content Area */
.analysis-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analysis-text {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    background-color: var(--panel-bg-color);
    border-radius: 4px;
    margin-bottom: 15px;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
    flex: 1;
}

/* Styles for HTML content in analysis modal */
.analysis-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.analysis-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: var(--text-color);
}

.analysis-text p {
    margin: 4px 0;
    line-height: 1.4;
}

.analysis-text ul,
.analysis-text ol {
    margin: 8px 0 8px 20px;
    padding-left: 0;
}

.analysis-text li {
    margin: 4px 0;
    line-height: 1.5;
}

.analysis-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text em {
    font-style: italic;
    color: var(--secondary-text-color);
}

.analysis-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Analysis table styling */
.analysis-text .analysis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.analysis-text .analysis-table th,
.analysis-text .analysis-table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.analysis-text .analysis-table th {
    background-color: var(--button-bg-color);
    font-weight: 600;
    color: var(--text-color);
}

.analysis-text .analysis-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text .analysis-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Collapsible details styling */
.analysis-text details {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.02);
}

.analysis-text details summary {
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    color: var(--text-color);
}

.analysis-text details summary:hover {
    color: var(--accent-color);
}

.analysis-text details[open] {
    padding-bottom: 4px;
}

.analysis-text details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.analysis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.analysis-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-family: 'Chakra Petch', sans-serif;
}

.modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.analysis-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.close-analysis-modal {
    background-color: var(--button-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.close-analysis-modal:hover {
    background-color: var(--button-hover-color);
}

.copy-analysis {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    transition: background-color 0.2s;
}

.copy-analysis:hover {
    background-color: var(--accent-hover-color);
}

/* Even more specific rules to ensure buttons align right */
#add-ship-button,
#ship-actions-button,
#analysis-tools-button {
    margin-left: 0 !important;
}

/* Force the button container to align right */
.ship-stats-header>div:last-child {
    margin-left: auto !important;
}

/* Alternative approach using flexbox on the parent */
.ship-stats-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Ensure the title doesn't take up all the space */
.ship-stats-header h2 {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

/* Force panel controls to take remaining space and align right */
.ship-stats-header .panel-controls {
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Components Panel */
#components-panel {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#components-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.stats-column,
.components-column {
    flex: 1;
    min-width: 300px;
    display: block !important;
}

/* Pattern Builder Content */
#pattern-builder-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pattern-builder-header {
    background-color: rgba(255, 215, 0, 0.05);
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pattern-builder-header h3 {
    margin: 0;
    color: #FFD700;
    font-size: 18px;
}

.pattern-builder-header .close-button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.pattern-builder-header .close-button:hover {
    color: #fff;
}

.pattern-builder-content {
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.pattern-info {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-text {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 13px;
}

.tier-one-status {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    line-height: 1.5;
}

.tier-one-status.success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.tier-one-status.warning {
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.tier-one-status.error {
    background-color: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.pattern-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pattern-control-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.pattern-control-btn:hover {
    background-color: #444;
}

.current-pattern-container {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
}

.pattern-name-section {
    margin-bottom: 20px;
}

.pattern-name-section label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.pattern-name-section input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-size: 13px;
}

.pattern-actions-section h4,
.pattern-test-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 14px;
}

.pattern-actions-list {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.pattern-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
}

.action-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-number {
    color: #666;
    font-weight: bold;
}

.action-description {
    color: #ccc;
    font-size: 12px;
}

.action-controls {
    display: flex;
    gap: 5px;
}

.action-controls button {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.action-controls button:hover:not(:disabled) {
    background-color: #444;
}

.action-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-action-btn {
    width: 100%;
    padding: 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-action-btn:hover {
    background-color: #1976D2;
}

.pattern-test-section,
.pattern-apply-section {
    margin-top: 20px;
}

.test-config-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.test-pattern-btn {
    width: 100%;
    padding: 8px;
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.test-pattern-btn:hover {
    background-color: #7B1FA2;
}

.pattern-apply-section {
    display: flex;
    gap: 10px;
}

.apply-pattern-btn,
.apply-all-btn {
    flex: 1;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.apply-pattern-btn:hover {
    background-color: #388E3C;
}

.apply-all-btn {
    background-color: #FF9800;
}

.apply-all-btn:hover {
    background-color: #F57C00;
}

.pattern-results {
    margin-top: 20px;
    padding: 15px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
}

/* Action Dialog Styles */
.action-dialog {
    max-width: 600px;
}

.action-type-select {
    margin-bottom: 20px;
}

.action-type-select label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-weight: bold;
}

.action-type-select select {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
}

.action-parameters {
    margin-bottom: 20px;
}

.parameter-group {
    margin-bottom: 15px;
}

.parameter-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 13px;
}

.parameter-group select,
.parameter-group input {
    width: 100%;
    padding: 8px;
    background-color: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 13px;
}

.parameter-section {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.parameter-section h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
    font-size: 13px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.add-button,
.cancel-button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.add-button {
    background-color: #4CAF50;
    color: white;
}

.add-button:hover {
    background-color: #388E3C;
}

.cancel-button {
    background-color: #666;
    color: white;
}

.cancel-button:hover {
    background-color: #555;
}

/* Force bold text on stat value spans - overrides any inheritance issues */
.stats-changed>span,
.stats-decreased>span,
.stats-neutral>span,
td.stats-changed>span,
td.stats-decreased>span,
td.stats-neutral>span {
    font-weight: bold !important;
}

/* Configuration loading indicator styles */
.config-loading {
    position: relative;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.config-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(61, 139, 248, 0.3) 50%,
            transparent 100%);
    animation: config-loading-sweep 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes config-loading-sweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.config-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #3d8bf8;
    animation: spin 1s linear infinite;
    z-index: 10;
    text-shadow: 0 0 5px rgba(61, 139, 248, 0.5);
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ship header loading state */
.ship-header.config-loading {
    background: linear-gradient(135deg,
            rgb(20, 30, 40) 0%,
            rgb(25, 35, 45) 50%,
            rgb(20, 30, 40) 100%);
    animation: config-header-pulse 1.5s ease-in-out infinite;
    position: relative;
    z-index: 9999;
}

@keyframes config-header-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }
}

/* Disabled dropdown styling during loading */
.config-dropdown:disabled {
    cursor: wait;
    background-color: rgb(30, 30, 30);
}

/* Progress bar for ship header */
.ship-header.config-loading::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #3d8bf8;
    animation: config-progress 1.5s ease-out forwards;
    z-index: 10;
}

@keyframes config-progress {
    0% {
        width: 0%;
    }

    80% {
        width: 90%;
    }

    100% {
        width: 100%;
    }
}

/* Configuration loading overlay with percentage and feed */
.config-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000000;
    border: 1px solid #333;
    border-radius: 0;
    padding: 10px;
    width: 450px;
    height: 500px;
    z-index: 99999;
    box-shadow: 0 0 20px rgb(0, 0, 0);
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
}

.config-loading-percentage {
    font-size: 48px;
    font-weight: normal;
    text-align: center;
    color: #3d8bf8;
    margin-bottom: 10px;
    text-shadow: none;
    font-family: 'Courier New', monospace;
}

/* File Drag and Drop Styles */
.file-drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.file-drop-zone.active {
    opacity: 1;
    pointer-events: all;
}

.drop-zone-content {
    text-align: center;
    padding: 60px;
    background: rgba(61, 139, 248, 0.1);
    border: 3px dashed #3d8bf8;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.file-drop-zone.active .drop-zone-content {
    transform: scale(1.05);
    background: rgba(61, 139, 248, 0.2);
    border-color: #4CAF50;
}

.drop-zone-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.drop-zone-text {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.drop-zone-subtext {
    font-size: 18px;
    color: #aaa;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Drop Success Message */
.drop-success-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2a2a2a;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100001;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.drop-success-message.show {
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    font-size: 30px;
}

.success-text {
    font-size: 16px;
    color: #fff;
    font-weight: 500;
}

/* Help Button Styles */
.help-button {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s ease;
    margin: 0 8px;
}

.help-button:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--accent-color);
}

.help-button svg {
    width: 20px;
    height: 20px;
}

/* Help Modal Styles */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.help-modal-overlay.active {
    display: flex;
}

.help-modal-dialog {
    position: relative;
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-modal-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.help-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.help-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.help-tab {
    background: transparent;
    border: none;
    color: var(--secondary-text-color);
    padding: 10px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: 'Chakra Petch', sans-serif;
}

.help-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.help-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(61, 139, 248, 0.1);
}

.help-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px 20px 10px 10px;
}

.tab-content {
    display: none;
}

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

.help-section {
    margin-bottom: 25px;
}

.help-section h4,
.help-section h5 {
    color: var(--accent-color);
    margin-bottom: 10px;
    margin-top: 0;
}

.help-section h4 {
    font-size: 1.1rem;
}

.help-section h5 {
    font-size: 1rem;
}

.help-section ul,
.help-section ol {
    margin-left: 20px;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

.help-section li {
    margin-bottom: 8px;
}

.help-section strong {
    color: var(--text-color);
}

.shortcut-section {
    margin-bottom: 30px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--background-secondary);
    border-radius: 4px;
}

.shortcut-keys {
    font-family: 'Courier New', monospace;
    background: var(--button-bg-color);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
}

.shortcut-description {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.help-button-row {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--background-secondary);
}

#closeHelpBtn {
    padding: 8px 20px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    transition: background-color 0.2s;
}

#closeHelpBtn:hover {
    background-color: var(--accent-hover-color);
}

/* Code blocks in help */
.help-code {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .help-modal-dialog {
        width: 95%;
        max-height: 95vh;
    }

    .help-tabs {
        flex-wrap: wrap;
    }

    .help-tab {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .shortcut-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== CONSUMABLES PANEL STYLES ==================== */
.consumables-container {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    max-width: 100%;
}

.consumables-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.consumables-header h4 {
    color: var(--accent-color);
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.restock-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.restock-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.consumables-section {
    margin-bottom: 15px;
}

.consumables-section h5 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.consumables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.consumable-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: 4px;
}

.consumable-item label {
    color: var(--text-color);
    font-size: 11px;
    min-width: 60px;
}

.consumable-input {
    width: 50px;
    padding: 2px 4px;
    background: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-color);
    font-size: 11px;
    position: relative;
}

.consumable-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Show current/max on hover */
.consumable-input:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    margin-bottom: 2px;
    border: 1px solid #444;
}

/* Style for left fleet inputs - green theme */
#left-ammo,
#left-missiles,
#left-counters,
#left-food,
#left-fuel,
#left-toolkits {
    border-color: #4CAF50;
}

#left-ammo:focus,
#left-missiles:focus,
#left-counters:focus,
#left-food:focus,
#left-fuel:focus,
#left-toolkits:focus {
    border-color: #81C784;
    box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Style for right fleet inputs - red theme */
#right-ammo,
#right-missiles,
#right-counters,
#right-food,
#right-fuel,
#right-toolkits {
    border-color: #ff4444;
}

#right-ammo:focus,
#right-missiles:focus,
#right-counters:focus,
#right-food:focus,
#right-fuel:focus,
#right-toolkits:focus {
    border-color: #ff6666;
    box-shadow: 0 0 3px rgba(255, 68, 68, 0.3);
}

.consumable-divider {
    color: #666;
    margin: 0 3px;
}

.stimulants-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stimulant-fleet-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
    border-radius: 4px;
}

.stimulant-fleet-section h6 {
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stimulant-select {
    width: 100%;
    padding: 4px;
    background: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-color);
    font-size: 11px;
    margin-bottom: 8px;
}

.stimulants-list {
    max-height: 120px;
    overflow-y: auto;
}

.stimulant-item {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.stimulant-name {
    font-size: 10px;
    color: var(--text-color);
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stimulant-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    outline: none;
    border-radius: 2px;
}

.stimulant-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

.stimulant-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

.stimulant-allocation {
    font-size: 10px;
    color: #999;
    min-width: 40px;
    text-align: right;
}

.stimulant-percentage {
    font-size: 12px;
    font-weight: bold;
    color: #4CAF50;
}

.stimulant-header {
    margin-bottom: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.stimulant-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.stimulant-warning {
    color: #ffa500;
    font-size: 11px;
    margin-top: 8px;
    text-align: center;
}

.remove-stimulant-btn {
    background: transparent;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 14px;
    padding: 0;
    transition: all 0.2s ease;
}

.remove-stimulant-btn:hover {
    background: #ff6b6b;
    color: white;
}

/* New Combat Configuration Layout */
.combat-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
}

.resources-section {
    margin-bottom: 20px;
}

.resources-columns {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.fleet-resources-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resource-grid {
    display: grid;
    gap: 8px;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-item label {
    font-size: 12px;
    color: #ccc;
    min-width: 70px;
}

.resource-input {
    width: 80px;
    padding: 4px 8px;
    background: var(--button-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-color);
    font-size: 12px;
    text-align: right;
}

.crew-display {
    font-weight: bold;
    color: #4CAF50;
    font-size: 14px;
}

.stimulants-section {
    margin-bottom: 20px;
}

.stimulants-columns {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.stimulant-fleet-section {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stimulants-list.scrollable {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.stimulants-list.scrollable::-webkit-scrollbar {
    width: 8px;
}

.stimulants-list.scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.stimulants-list.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.stimulants-list.scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.combat-controls-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin-top: 20px;
}

.strike-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.first-striker-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.first-striker-control label {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vs-section {
    padding: 0 20px;
}

.vs-text {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Left fleet resource inputs - green theme */
.fleet-resources-panel:first-child .resource-input {
    border-color: #4CAF50;
}

.fleet-resources-panel:first-child .resource-input:focus {
    border-color: #81C784;
    box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Right fleet resource inputs - red theme */
.fleet-resources-panel:last-child .resource-input {
    border-color: #ff4444;
}

.fleet-resources-panel:last-child .resource-input:focus {
    border-color: #ff6666;
    box-shadow: 0 0 3px rgba(255, 68, 68, 0.3);
}

/* Buff/Debuff Display Styles */
.buff {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9em;
}

.debuff {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 0.9em;
}

/* Combat Simulator Center Section Redesign */
.center-section {
    flex: 0 1 750px;
    min-width: 500px;
    display: flex;
    flex-direction: column;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin: 0 5px;
    height: calc(100vh - 180px);
    overflow: hidden;
}

.vs-header {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    margin-bottom: 15px;
    letter-spacing: 5px;
}

.consumables-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.combat-controls-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.first-striker-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 13px;
}

.first-striker-control label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.alpha-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.alpha-control-group {
    text-align: center;
}

.alpha-control-group h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
}

.alpha-control-group label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.alpha-tier-select {
    width: 100%;
    padding: 5px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
}

.resources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.resources-header h3 {
    margin: 0;
    font-size: 16px;
}

.resources-section {
    margin-bottom: 10px;
    flex-shrink: 0;
    overflow: visible;
}

.resources-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fleet-resources-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fleet-resources-panel h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    text-align: center;
}

.resource-grid {
    display: grid;
    gap: 6px;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    overflow: visible;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.resource-item label {
    font-size: 12px;
    color: #ccc;
    min-width: 70px;
}

.resource-input {
    width: 80px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    text-align: right;
}

.crew-display {
    font-weight: bold;
    color: #4CAF50;
    font-size: 13px;
}

.stimulants-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stimulants-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.stimulant-fleet-section {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    overflow: hidden;
}

.stimulant-fleet-section h6 {
    margin: 0 0 8px 0;
    font-size: 14px;
    text-align: center;
}

.stimulant-select {
    width: 100%;
    padding: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 10px;
}

.stimulants-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    max-height: 500px;
}

.stimulant-header {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
}

.stimulant-header div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stimulant-header span {
    font-size: 11px;
}

.stimulant-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stimulant-name {
    font-size: 11px !important;
    color: #fff;
}

.stimulant-percentage {
    font-size: 11px !important;
    font-weight: bold;
    color: #4CAF50;
}

.stimulant-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    opacity: 0.9;
    transition: all 0.2s;
    border-radius: 4px;
    margin: 5px 0;
    cursor: pointer;
}

.stimulant-slider:hover {
    opacity: 1;
}

.stimulant-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.stimulant-slider::-webkit-slider-thumb:hover {
    background: #5cbf60;
    transform: scale(1.1);
}

.stimulant-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4CAF50;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.stimulant-slider::-moz-range-thumb:hover {
    background: #5cbf60;
    transform: scale(1.1);
}

.stimulant-allocation {
    font-size: 10px !important;
    color: #999;
    min-width: 50px;
}

.stimulant-warning {
    font-size: 10px !important;
    padding: 5px;
    border-radius: 3px;
    text-align: center;
    margin-top: 8px;
}

.remove-stimulant-btn {
    background: transparent;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-stimulant-btn:hover {
    background: #ff6b6b;
    color: white;
}

.fight-button-container {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    margin-top: auto;
}

.fight-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 6px 26px;
    font-size: 9px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    transition: all 0.3s ease;
}

.fight-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
    transform: translateY(-2px);
}

/* Scrollbar styling for stimulants lists */
.stimulants-list::-webkit-scrollbar {
    width: 6px;
}

.stimulants-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.stimulants-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.stimulants-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* New Column Layout for Combat Config */
.first-striker-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
    text-align: center;
}

.first-striker-label {
    font-size: 14px;
    font-weight: bold;
    color: #ffd700;
    margin-right: 15px;
}

.first-striker-options {
    display: inline-flex;
    gap: 20px;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-option input[type="radio"] {
    margin: 0;
}

.left-option {
    color: #4CAF50;
}

.right-option {
    color: #ff4444;
}

.combat-config-columns {
    flex: 1;
    display: flex;
    gap: 12px;
    overflow: visible;
    min-height: 0;
}

.fleet-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 800px;
}

.fleet-column.first-striker-active {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.fleet-header {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.left-fleet-column .fleet-header {
    color: #4CAF50;
}

.right-fleet-column .fleet-header {
    color: #ff4444;
}

.alpha-controls {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
}

.alpha-control {
    margin-bottom: 8px;
}

.alpha-control:last-child {
    margin-bottom: 0;
}

.alpha-control label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
}

.section-title {
    font-size: 13px;
    font-weight: bold;
    color: #4169E1;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.stimulants-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 10px;
    min-height: 100px;
}

.stimulants-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    max-height: 500px;
}

.restock-button-container {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.restock-button {
    background: linear-gradient(135deg, #4169E1 0%, #1E90FF 100%);
    color: white;
    border: none;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(65, 105, 225, 0.4);
    transition: all 0.3s ease;
}

.restock-button:hover {
    background: linear-gradient(135deg, #1E90FF 0%, #4169E1 100%);
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.6);
    transform: translateY(-1px);
}

.depleted {
    opacity: 0.5;
    color: #ff6b6b;
}

/* Consumable resource tooltips */
.consumable-item label[title] {
    cursor: help;
    position: relative;
}

.consumable-item label[title]:hover {
    color: #ffd700;
}

/* Combat simulator stat indicators */
.fleet-stats .stat-value .debuff {
    color: #f87171;
    font-weight: bold;
}

.fleet-stats .stat-value .buff {
    color: #4ade80;
    font-weight: bold;
}