/* ========== Dark Theme - Monochromatic Minimalism ========== */

/* Body and main layout */
body.dark-theme {
    background: radial-gradient(
        ellipse at center,
        #2a2a2a 0%,
        #1c1c1c 60%,
        #121212 100%
    );
    color: #e0e0e0;
}

/* Header */
.dark-theme #top {
    background-color: #1c1c1c;
    border-bottom: 1px solid #333333;
    color: #e0e0e0;
}

/* Header brand and links */
.dark-theme .header-brand {
    cursor: pointer;
    font-family: Materiam, sans-serif;
    font-size: 44px;
    color: #ffffff;
    margin-left: 10px;
    margin-top:2px;
    width: 250px;
}

.dark-theme .header-link {
    color: #ffffff;
}

.dark-theme .header-link:hover {
    color: #e0e0e0;
}

/* Footer */
.dark-theme #bottom {
    background-color: #1c1c1c;
    border-top: 1px solid #333333;
}

/* Footer text */
.dark-theme .footer-text {
    color: #ffffff;
    font-size: 24px;
}

/* Center content */
.dark-theme .center_content {
    color: #e0e0e0;
}

/* Links - monochromatic */
.dark-theme a:link, .dark-theme a:visited {
    color: #e0e0e0;
}

.dark-theme a:link:hover, .dark-theme a:visited:hover {
    color: #ffffff;
}

/* PrimeFaces Components - Monochromatic */

/* Panels */
.dark-theme .ui-panel {
    background-color: #1c1c1c;
    border: 1px solid #333333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark-theme .ui-panel-titlebar {
    background: #242424;
    border-bottom: 1px solid #333333;
    color: #ffffff;
}

.dark-theme .ui-panel-content {
    background-color: #1c1c1c;
    color: #e0e0e0;
}

/* TabView */
.dark-theme .ui-tabs {
    background-color: transparent;
    border: none;
}

.dark-theme .ui-tabs-nav {
    background-color: #242424;
    border: 1px solid #333333;
    border-bottom: none;
}

.dark-theme .ui-tabs-nav li {
    background-color: transparent;
    border: none;
}

.dark-theme .ui-tabs-nav li a {
    color: #a0a0a0;
}

.dark-theme .ui-tabs-nav li.ui-tabs-active a,
.dark-theme .ui-tabs-nav li:hover a {
    color: #ffffff;
}

.dark-theme .ui-tabs-nav li.ui-tabs-active {
    border-bottom: 2px solid #e0e0e0;
}

.dark-theme .ui-tabs-panels {
    background-color: #1c1c1c;
    border: 1px solid #333333;
    color: #ffffff;
}

/* DataTable */
.dark-theme .ui-datatable {
    background-color: #1c1c1c;
}

.dark-theme .ui-datatable thead th {
    background: #242424;
    color: #a0a0a0;
    border-bottom: 1px solid #333333;
}

.dark-theme .ui-datatable tbody td {
    color: #e0e0e0;
    border-bottom: 1px solid #333333;
}

.dark-theme .ui-datatable tbody tr:hover td {
    background: #383838;
}

.dark-theme .ui-datatable-even {
    background-color: #2a2a2a !important;
}

.dark-theme .ui-datatable-odd {
    background-color: #323232 !important;
}

/* Input fields - monochromatic */
.dark-theme .ui-inputfield,
.dark-theme .ui-inputnumber,
.dark-theme .ui-inputtext {
    background-color: #1c1c1c;
    color: #ffffff;
    border: 1px solid #333333;
}

.dark-theme .ui-inputfield:focus {
    border-color: #666666;
    box-shadow: none;
}

/* SelectOneMenu */
.dark-theme .ui-selectonemenu {
    background-color: #1c1c1c;
    color: #ffffff;
    border: 1px solid #333333;
}

.dark-theme .ui-selectonemenu-trigger {
    background-color: #2e2e2e;
    color: #ffffff;
}

.dark-theme .ui-selectonemenu-panel {
    background-color: #242424;
    border: 1px solid #333333;
}

.dark-theme .ui-selectonemenu-items {
    background-color: #242424;
}

.dark-theme .ui-selectonemenu-item {
    color: #e0e0e0;
}

.dark-theme .ui-selectonemenu-item:hover {
    background-color: #383838;
}

/* Buttons - monochromatic */
.dark-theme .ui-button {
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #333333;
}

.dark-theme .ui-button:hover {
    background-color: #383838;
}

.dark-theme .ui-button-danger {
    background-color: #a0a0a0;
    color: #1c1c1c;
}

.dark-theme .ui-button-danger:hover {
    background-color: #ffffff;
    color: #1c1c1c;
}

/* Labels */
.dark-theme label,
.dark-theme .ui-outputlabel {
    color: #e0e0e0;
}

/* Form container */
.dark-theme .form-container {
    background-color: #1c1c1c;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark-theme .form-field label {
    color: #e0e0e0;
}

/* Dialogs */
.dark-theme .ui-dialog {
    background-color: #1c1c1c;
    border: 1px solid #333333;
}

.dark-theme .ui-dialog-titlebar {
    background-color: #242424;
    color: #ffffff;
}

.dark-theme .ui-dialog-content {
    background-color: #1c1c1c;
    color: #e0e0e0;
}

/* Growl messages */
.dark-theme .ui-growl-item {
    background-color: #242424;
    border: 1px solid #333333;
}

/* Admin grid cards */
.dark-theme .admin-card {
    background-color: #242424;
    border: 1px solid #333333;
}

.dark-theme .admin-card:hover {
    background-color: #2e2e2e;
    border-color: #666666;
}

/* Preferences button */
.dark-theme .preferences-btn {
    background-color: transparent;
    color: #a0a0a0;
    border: 1px solid #333333;
}

.dark-theme .preferences-btn:hover {
    color: #ffffff;
    border-color: #666666;
}

/* ========== Admin Page Styles ========== */

/* Admin page container */
.dark-theme .admin-container {
    background-color: #1c1c1c;
    min-height: 100vh;
    padding: 20px;
}

/* Admin page header */
.dark-theme .admin-header {
    font-family: Materiam, sans-serif;
    font-size: 24px;
    color: #ffffff;
    background-color: #242424;
    padding: 15px 20px;
    border-radius: 0;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #333333;
}

/* Admin menu grid */
.dark-theme .admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
    background-color: transparent;
}

/* Admin menu card */
.dark-theme .admin-menu-card {
    cursor: pointer;
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.dark-theme .admin-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.4);
}

.dark-theme .admin-menu-card-content {
    background-color: white;
    color: black;
    padding: 20px;
    text-align: center;
    font-family: Materiam, sans-serif;
    font-size: 20px;
}

.dark-theme .admin-menu-card-content img {
    width: 100%;
    max-width: 200px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Status indicators - monochromatic */
.dark-theme .status-active {
    color: #a0a0a0;
}

.dark-theme .status-inactive {
    color: #505050;
}

/* ========== Header Nav Buttons ========== */
.dark-theme .header-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dark-theme .header-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ffffff;
}

.dark-theme .header-nav-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dark-theme .header-nav-btn:hover svg {
    stroke: #ffffff;
}

.dark-theme .header-nav-btn .nav-label {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dark-theme .header-nav-btn:hover .nav-label {
    color: #ffffff;
}

/* Admin nav button - red variant */
.dark-theme .header-nav-btn-admin {
    border-color: rgba(229, 62, 62, 0.6);
    color: #e53e3e;
}

.dark-theme .header-nav-btn-admin:hover {
    background: rgba(229, 62, 62, 0.15);
    border-color: #e53e3e;
    color: #fc5555;
}

.dark-theme .header-nav-btn-admin .nav-label {
    color: #e53e3e;
}

.dark-theme .header-nav-btn-admin:hover .nav-label {
    color: #fc5555;
}

/* ========== DataView ========== */
.dark-theme .ui-dataview {
    background-color: #1c1c1c;
    border: 1px solid #333333;
}

.dark-theme .ui-dataview-header {
    background-color: #242424;
    border-bottom: 1px solid #333333;
    color: #e0e0e0;
}

.dark-theme .ui-dataview-content {
    background-color: #1c1c1c;
    color: #e0e0e0;
}

.dark-theme .ui-dataview .ui-dataview-row {
    background-color: #1c1c1c;
    border-bottom: 1px solid #333333;
}

.dark-theme .ui-dataview .ui-dataview-row:hover {
    background-color: #2a2a2a;
}

/* DataView grid items */
.dark-theme .product-grid-item {
    background-color: #242424;
    border: 1px solid #333333;
}

.dark-theme .product-grid-item:hover {
    border-color: #666666;
}

.dark-theme .product-grid-item-top,
.dark-theme .product-grid-item-content,
.dark-theme .product-grid-item-bottom {
    color: #e0e0e0;
}

/* DataView paginator */
.dark-theme .ui-dataview .ui-paginator {
    background-color: #242424;
    border-top: 1px solid #333333;
}

.dark-theme .ui-dataview .ui-paginator .ui-paginator-page,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-first,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-prev,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-next,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-last {
    background-color: #2e2e2e;
    color: #e0e0e0;
    border: 1px solid #333333;
}

.dark-theme .ui-dataview .ui-paginator .ui-paginator-page:hover,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-first:hover,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-prev:hover,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-next:hover,
.dark-theme .ui-dataview .ui-paginator .ui-paginator-last:hover {
    background-color: #383838;
}

.dark-theme .ui-dataview .ui-paginator .ui-paginator-page.ui-state-active {
    background-color: #505050;
    color: #ffffff;
}

.dark-theme .ui-dataview .ui-paginator .ui-paginator-current {
    color: #a0a0a0;
}

/* Project thumbnail in DataView */
.dark-theme .project-thumbnail-container {
    margin: 5px;
    box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.6);
    width: 270px;
    background-color: #2a2a2a;
}

.dark-theme .project-thumbnail {
    width: 260px;
    margin-left: 5px;
    cursor: pointer;
    background-color: #2a2a2a;
}

/* ========== Weld Panel Theme Styles ========== */

/* Main weld panel - visual styling only */
.weld-panel {
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Panel header */
.weld-panel-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
}

/* Title row with count badge */
.weld-panel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.weld-panel-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.weld-panel-count {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.weld-panel-close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #888;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.weld-panel-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Weld toolbar */
.weld-panel-toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weld-panel-sub-buttons {
    display: flex;
    gap: 6px;
    padding-left: 8px;
}

.weld-panel-btn-sub {
    flex: 1;
    font-size: 11px !important;
    padding: 4px 8px !important;
}

.weld-panel-btn-add-welds {
    width: 100%;
}

.weld-panel-btn-add-welds.active {
    background: rgba(255, 100, 100, 0.2) !important;
    color: #ff6b6b !important;
    border-color: rgba(255, 100, 100, 0.3) !important;
}

.weld-panel-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #aaa;
    font-size: 11px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.weld-panel-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.weld-panel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.weld-panel-btn.active {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border-color: rgba(255, 152, 0, 0.3);
}

.weld-panel-btn .btn-icon {
    font-size: 12px;
}

/* Proximity slider row */
.weld-panel-proximity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 6px;
}

.weld-panel-proximity-label {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
}

.weld-panel-proximity-slider {
    width: 80px;
    flex-shrink: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.weld-panel-proximity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #ff9800;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.weld-panel-proximity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.weld-panel-proximity-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #ff9800;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.weld-panel-proximity-value {
    color: #ff9800;
    font-size: 11px;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* Weld list */
.weld-panel-list {
    padding: 8px;
}

.weld-panel-list::-webkit-scrollbar {
    width: 6px;
}

.weld-panel-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.weld-panel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.weld-panel-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Empty state message */
.weld-panel-empty {
    color: #666;
    font-size: 11px;
    text-align: center;
    padding: 20px 10px;
    line-height: 1.4;
}

/* Individual weld item */
.weld-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.weld-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 152, 0, 0.3);
}

.weld-item-highlighted {
    background: rgba(0, 255, 255, 0.2) !important;
    border-color: rgba(0, 255, 255, 0.8) !important;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.weld-item:last-child {
    margin-bottom: 0;
}

/* Weld item names row */
.weld-item-names {
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Weld item details row */
.weld-item-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Weld type dropdown */
.weld-type-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #ccc;
    font-size: 10px;
    padding: 3px 4px;
    cursor: pointer;
    min-width: 65px;
}

.weld-type-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.weld-type-select:focus {
    outline: none;
    border-color: rgba(255, 152, 0, 0.4);
}

.weld-type-select option {
    background: #242424;
    color: #ccc;
}

/* Welding process dropdown (MIG/TIG) */
.weld-process-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #ccc;
    font-size: 10px;
    padding: 3px 4px;
    cursor: pointer;
    min-width: 45px;
}

.weld-process-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.weld-process-select:focus {
    outline: none;
    border-color: rgba(255, 152, 0, 0.4);
}

.weld-process-select option {
    background: #242424;
    color: #ccc;
}

/* Weld size input */
.weld-size-container {
    display: flex;
    align-items: center;
    gap: 2px;
}

.weld-size-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #ccc;
    font-size: 10px;
    padding: 3px 4px;
    width: 36px;
    text-align: right;
}

.weld-size-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.weld-size-input:focus {
    outline: none;
    border-color: rgba(255, 152, 0, 0.4);
}

/* Remove spinner buttons from number input */
.weld-size-input::-webkit-outer-spin-button,
.weld-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.weld-size-input[type=number] {
    -moz-appearance: textfield;
}

.weld-size-label {
    color: #666;
    font-size: 9px;
}

/* Weld length display */
.weld-length {
    color: #888;
    font-size: 10px;
    flex: 1;
    text-align: right;
}

/* Delete button */
.weld-delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 100, 100, 0.5);
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
    line-height: 1;
}

.weld-delete-btn:hover {
    color: #ff6b6b;
}

/* ========== Weld Part Pair Groups (Tree) ========== */
.weld-group {
    margin-bottom: 4px;
}

.weld-group:last-child {
    margin-bottom: 0;
}

.weld-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.weld-group-header:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.3);
}

.weld-group-header.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.weld-group-expand-icon {
    color: rgba(255, 152, 0, 0.7);
    font-size: 8px;
    width: 10px;
    transition: transform 0.15s ease;
}

.weld-group-name {
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weld-group-count {
    background: rgba(255, 152, 0, 0.25);
    color: rgba(255, 152, 0, 0.9);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.weld-group-delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 100, 100, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
    line-height: 1;
    margin-left: auto;
    opacity: 0;
}

.weld-group-header:hover .weld-group-delete-btn {
    opacity: 1;
}

.weld-group-delete-btn:hover {
    color: #ff6b6b;
}

.weld-group-children {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.15);
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 6px;
}

/* Compact weld items inside groups */
.weld-group-children .weld-item {
    margin-bottom: 4px;
    padding: 6px 8px;
}

.weld-group-children .weld-item:last-child {
    margin-bottom: 0;
}

.weld-item-compact {
    /* Compact mode styling - no names row */
}

.weld-item-compact .weld-item-details {
    /* Details take full space in compact mode */
}

