/* ============================================
   8bitedge Lots / Lot Manager
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Electrolize&display=swap');

.lots-main,
.lots-container,
.lots-card,
.lots-form,
.lots-table {
    font-family: 'Electrolize', sans-serif;
}

/* Main Container */
.lots-main {
    width: 100%;
    padding: 24px 0 0 0;
    margin: 0;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d35 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.lots-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.025) 0px,
        transparent 2px,
        transparent 4px,
        rgba(0, 217, 255, 0.025) 6px
    );
    pointer-events: none;
    z-index: 0;
}

.lots-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    position: relative;
    z-index: 1;
}

/* Top row: Order + Performance side by side */
.lots-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.lots-col-half {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
}

.lots-col-full {
    flex: 1 1 100%;
    min-width: 0;
}

/* Card */
.lots-card {
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Header */
.lots-card-header {
    padding: 14px 40px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.lots-card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.lots-title-label {
    color: #e8f6ff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.88rem;
    font-family: 'Electrolize', sans-serif;
}

.lots-title-sub {
    color: #b8b8c8;
    font-size: 0.78rem;
    font-weight: 400;
}

/* Profit badge */
.lots-badge {
    background: rgba(0, 255, 65, 0.1);
    color: #00ff41;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.78rem;
    border: 1px solid rgba(0, 255, 65, 0.3);
    font-family: 'Electrolize', sans-serif;
    letter-spacing: 0.5px;
}

.lots-arrow {
    font-style: normal;
    margin-right: 4px;
}

/* Card Body */
.lots-card-body {
    padding: 22px 40px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Form */
.lots-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lots-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lots-field-label {
    color: #00d9ff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lots-select,
.lots-field select {
    width: 100%;
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 0;
    color: #e8f6ff;
    padding: 0.4rem 0.6rem;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
}

.lots-select:focus,
.lots-field select:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.5);
}

.lots-select option,
.lots-field select option {
    background: #0a0e27;
    color: #e8f6ff;
}

/* Brand group headers in the console picker — matches the /search filter. */
.lots-select optgroup,
.lots-field select optgroup {
    background: #0a0e27;
    color: #00ff41;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Tom Select overrides */
.ts-wrapper {
    width: 100%;
}

.ts-control {
    background: rgba(10, 10, 20, 0.65) !important;
    border: 1px solid rgba(0, 217, 255, 0.25) !important;
    border-radius: 0 !important;
    color: #e8f6ff !important;
    padding: 0.4rem 0.6rem !important;
    font-family: 'Electrolize', sans-serif !important;
    font-size: 0.82rem !important;
    min-height: unset !important;
    box-shadow: none !important;
}

.ts-control:focus,
.ts-wrapper.focus .ts-control {
    border-color: rgba(0, 217, 255, 0.5) !important;
    box-shadow: none !important;
    outline: none !important;
}

.ts-control .item {
    background: rgba(0, 217, 255, 0.12) !important;
    color: #00d9ff !important;
    border: 1px solid rgba(0, 217, 255, 0.3) !important;
    border-radius: 0 !important;
    padding: 2px 8px !important;
    font-weight: 600 !important;
    margin: 2px !important;
    text-shadow: none !important;
    box-shadow: none !important;
    font-size: 0.78rem !important;
}

.ts-control .item .remove {
    color: #00d9ff !important;
    border-left: 1px solid rgba(0, 217, 255, 0.2) !important;
    padding-left: 6px !important;
    margin-left: 6px !important;
}

.ts-dropdown {
    background: #0a0e27 !important;
    border: 1px solid rgba(0, 217, 255, 0.25) !important;
    border-radius: 0 !important;
    border-top: none !important;
    box-shadow: none !important;
    color: #e8f6ff !important;
    font-family: 'Electrolize', sans-serif !important;
    font-size: 0.82rem !important;
}

.ts-dropdown .option {
    padding: 0.4rem 0.6rem !important;
    color: #b8b8c8 !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 217, 255, 0.06) !important;
    cursor: pointer !important;
}

.ts-dropdown .option:last-child {
    border-bottom: none !important;
}

.ts-dropdown .option.active,
.ts-dropdown .option:hover {
    background: rgba(0, 217, 255, 0.07) !important;
    color: #00d9ff !important;
    text-shadow: none !important;
}

.ts-dropdown .option.selected {
    background: rgba(0, 217, 255, 0.1) !important;
    color: #00d9ff !important;
}

.ts-dropdown .no-results {
    padding: 0.5rem 0.6rem !important;
    color: #b8b8c8 !important;
}

.ts-control input {
    color: #e8f6ff !important;
}

.ts-control input::placeholder {
    color: rgba(184, 184, 200, 0.4) !important;
}

/* Add Games button */
.lots-btn-primary {
    align-self: flex-start;
    padding: 6px 16px;
    background: linear-gradient(135deg, #00d9ff 0%, #00ff41 100%);
    border: 1px solid transparent;
    border-radius: 6px;
    color: #0a0e27;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.25);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.lots-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 22px rgba(0, 255, 65, 0.4);
}

/* Reset / secondary button */
.lots-btn-secondary {
    padding: 4px 14px;
    background: linear-gradient(135deg, #00d9ff 0%, #00ff41 100%);
    border: 1px solid transparent;
    border-radius: 6px;
    color: #0a0e27;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.25);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.lots-btn-secondary:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 22px rgba(0, 255, 65, 0.4);
}

.lots-btn-secondary:disabled {
    color: #0a0e27 !important;
    -webkit-text-fill-color: #0a0e27;
    opacity: 1;
    border-color: rgba(0, 217, 255, 0.1);
    cursor: not-allowed;
}

/* Checkbox */
.lots-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.lots-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #00d9ff;
    cursor: pointer;
}

.lots-checkbox label {
    color: #b8b8c8;
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
}

/* Performance Stats */
.lots-stats {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex: 1;
}

.lots-stats-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.lots-stats-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 1rem;
}

.lots-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lots-stat-bullet {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.lots-stat-bullet.profit { background: #00ff41; }
.lots-stat-bullet.cost   { background: #00d9ff; }
.lots-stat-bullet.value  { background: #FFC700; }

.lots-stat-label {
    color: #b8b8c8;
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 50px;
}

.lots-stat-value {
    margin-left: auto;
    color: #e8f6ff;
    font-weight: 700;
    font-size: 0.82rem;
}

.lots-chart {
    min-height: 120px;
    width: 120px;
}

/* Table Controls (header of bottom card) */
.lots-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 10px 40px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.lots-controls-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lots-controls-right {
    display: flex;
    align-items: center;
}

.lots-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lots-control-group .lots-field-label {
    margin-bottom: 0;
}

.lots-control-select {
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 0;
    color: #e8f6ff;
    padding: 0.3rem 1.6rem 0.3rem 0.5rem;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d9ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
}

.lots-control-select:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.5);
}

.lots-control-select option {
    background: #0a0e27;
    color: #e8f6ff;
}

/* Insights Table */
.lots-table-wrap {
    padding: 0 40px 22px;
    overflow-x: auto;
}

.lots-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

.lots-table thead {
    background: rgba(10, 10, 20, 0.65);
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.lots-table thead th {
    color: #00d9ff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0.75rem;
    border: none;
    font-size: 0.78rem;
    font-family: 'Electrolize', sans-serif;
}

.lots-table thead th.text-end { text-align: right; }

.lots-table tbody tr {
    background: rgba(10, 10, 20, 0.65);
    border-bottom: 1px solid rgba(0, 217, 255, 0.08);
}

.lots-table tbody tr:hover {
    background: rgba(0, 217, 255, 0.04);
}

.lots-table tbody tr.removing {
    animation: lots-row-remove 0.4s ease forwards;
    pointer-events: none;
}

@keyframes lots-row-remove {
    0%   { opacity: 1; background: rgba(0, 217, 255, 0.08); }
    100% { opacity: 0; background: rgba(0, 217, 255, 0); }
}

.lots-table tbody td {
    color: #b8b8c8;
    padding: 0.45rem 0.75rem;
    border: none;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Electrolize', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.lots-table tbody td.text-end { text-align: right; }

.lots-table tbody td a {
    color: #00d9ff;
    text-decoration: none;
}

.lots-table tbody td a:hover {
    color: #e8f6ff;
}

.lots-table .remove-icon {
    color: rgba(0, 217, 255, 0.4);
    cursor: pointer;
    transition: color 0.2s ease;
}

.lots-table .remove-icon:hover {
    color: #00d9ff;
}

.remove-deleting {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.remove-deleting span {
    width: 4px;
    height: 4px;
    background: rgba(0, 217, 255, 0.5);
    animation: lots-dot-blink 1s step-end infinite;
}

.remove-deleting span:nth-child(2) { animation-delay: 0.33s; }
.remove-deleting span:nth-child(3) { animation-delay: 0.66s; }

/* Table Footer */
.lots-table-footer {
    padding: 10px 40px;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(184, 184, 200, 0.6);
    font-family: 'Electrolize', sans-serif;
}

.lots-table-footer a {
    color: rgba(184, 184, 200, 0.6);
    text-decoration: none;
}

.lots-table-footer a:hover {
    color: #00d9ff;
}

/* Loading overlay */
.lots-table-wrap,
.lots-card {
    position: relative;
}

.lots-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.75);
    z-index: 10;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #00d9ff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lots-loading.active {
    display: flex;
}

.lots-loading-dots {
    display: flex;
    gap: 5px;
}

.lots-loading-dots span {
    width: 6px;
    height: 6px;
    background: #00d9ff;
    animation: lots-dot-blink 1s step-end infinite;
}

.lots-loading-dots span:nth-child(2) { animation-delay: 0.33s; }
.lots-loading-dots span:nth-child(3) { animation-delay: 0.66s; }

@keyframes lots-dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

/* Scrollbar */
.lots-table-wrap::-webkit-scrollbar { height: 6px; }
.lots-table-wrap::-webkit-scrollbar-track { background: rgba(10, 10, 20, 0.65); }
.lots-table-wrap::-webkit-scrollbar-thumb { background: rgba(0, 217, 255, 0.3); }
.lots-table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(0, 217, 255, 0.5); }

/* Responsive */
@media (max-width: 768px) {
    .lots-col-half { flex-basis: 100%; }

    .lots-card-header,
    .lots-card-body,
    .lots-controls,
    .lots-table-wrap,
    .lots-table-footer { padding-left: 20px; padding-right: 20px; }

    .lots-stats { flex-direction: column; }
    .lots-stats-right { justify-content: center; padding-right: 0; }

    .lots-controls { flex-direction: column; align-items: flex-start; }
    .lots-controls-left { width: 100%; flex-direction: column; }
    .lots-control-group { width: 100%; }
    .lots-control-select { width: 100%; }

    .lots-table-footer { flex-direction: column; gap: 4px; }
}
