html, body {
    margin-left: 15px;
    margin-right: 15px;
}

/* ---------------------------
WIP BANNER
--------------------------- */

#wip-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-family: "Inter", sans-serif;
    padding: 9px 40px;
    position: relative;
    margin-left: -15px;
    margin-right: -15px;
    letter-spacing: 0.01em;
}

.wip-text {
    opacity: 0.9;
}

.wip-dismiss {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    padding: 0 4px;
}

.wip-dismiss:hover {
    opacity: 1;
}

body {
    font-family: "Inter", sans-serif;
    background: #ffffff;
    color: #222;
    box-sizing: border-box;
}

.panel-title {
    font-size: 24px;
    font-weight: 600;
    margin: 20px;
    text-align: left;
}

.panel-subtitle {
    font-size: 14px;
    color: hsl(0, 0%, 50%);
    margin-top: 2px;
    font-weight: 100;
    text-align: left;
    font-style: italic;
}

.Info-Text {
    padding-bottom: 4px;
    max-width: 280px;
    color: #4a4a4a;
    font-size: 12px;
    line-height: 1.45;
    text-align: justify;
}

.Info-Text h4 {
    margin-top: 12px;
    margin-bottom: 0px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.02em;
}

.Info-Text p {
    margin-top: 0px;
}

/* Layout */

.dashboard {
    display: flex;
    gap: 30px;
    height: calc(100vh - 60px);
    margin-top: 30px;
}

/* Left Panel */

.side-panel {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgb(200,200,200);
}

/* RIGHT PANEL */

.canvas-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    border: 1px solid rgb(200, 200, 200);
}

.canvas-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    gap: 6px;
    z-index: 10;
}

.control-button {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}

.control-button:hover {
    background: #f3f3f3;
}

/* Cards */

.card {
    background: white;
    border-radius: 0px;
    background-color: #ffffff;
}

.card:last-child {
    flex: 1;
}

.card h3 {
    margin: 12px 0 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.02em;
}

/* Rooms */

.room {
    stroke: #333;
    stroke-width: 1;
    fill-opacity: 0.75;
    transition: all 0.15s ease;
}

.room:hover {
    stroke-width: 3;
}

.room.dimmed {
    fill-opacity: 0.15;
}

.room.highlighted {
    stroke-width: 3;
    fill-opacity: 0.95;
}

/* Room colors */

.common {
    fill: #6fbf73;
}

.private {
    fill: #5fa4e8;
}

/* Legend */

.legend-row {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    margin-top: 6px;
    font-size: 14px;
    cursor: pointer;
}

.legend-row:hover {
    font-weight: 600;
}

.legend-box {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 3px;
}

.legend-row span {
    margin-bottom: 0px;
    margin-top: 0px;
    font-size: 12px;
}

.common-box {
    background: #6fbf73;
}

.private-box {
    background: #5fa4e8;
}

/* ---------------------------
METRICS DASHBOARD
--------------------------- */

.metrics-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
    letter-spacing: 0.02em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 6px;
    text-align: left;
}

.metric-label {
    padding-bottom: 4px;
    max-width: 235px;
    color: #4a4a4a;
    font-size: 12px;
    line-height: 1.45;
    text-align: justify;
}

.metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.metric-card:hover {
    border-color: #999;
}

.metric-card:first-child {
    background: hsla(0, 0%, 0%, 0.05);
}

#tooltip {
    position: absolute;
    z-index: 999;
    left: 22px;
    top: 0px;
    background: white;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* ---------------------------
VARIANT PANEL
--------------------------- */

.variants-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0px;
}

.variants-subtitle {
    font-size: 11px;
    color: #777;
    margin-top: 10px;
}

.variants-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.02em;
    margin: 0px;
}

#variant-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-order {
    font-size: 12px;
    color: #575757;
    margin-top: 2px;
}

.variant-thumb {
    border: 1px solid #ccc;
    padding: 6px;
    cursor: pointer;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.variant-thumb.selected {
    border: 2px solid hwb(0 0% 100%);
}

.variant-thumb:hover {
    border: 2px solid rgba(0, 0, 0, 0.35);
}

.variant-thumb svg {
    background: #fafafa;
}

.variant-rank {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.variant-eff {
    margin-top: 4px;
    font-size: 11px;
}

.best-star {
    margin-left: 6px;
    font-size: 13px;
    font-weight: bold;
}

/* Compare Button */

.compare-button {
    font-size: 11px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.compare-button:hover {
    background: #f3f3f3;
}

.compare-button.active {
    background: #222;
    color: white;
    border-color: #222;
}

#canvas-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    flex-direction: row;
    min-height: 0;
    position: relative;
}

.compare-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    display: block;
}

.compare-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid #ccc;
}

.compare-wrapper:last-child {
    border-right: none;
}

#floorplan {
    display: block;
}

#canvas-container svg {
    width: 100%;
    height: 100%;
}

.compare-selected {
    border: 2px solid black;
}

#metrics-container {
    display: flex;
    gap: 16px;
    border-top: 1px solid #ddd;
    padding: 16px;
    background: #fafafa;
    align-items: stretch;
}

.metrics-card {
    flex: 1 1 50%;
    font-size: 12px;
    line-height: 1.5;
    min-width: 0;
    border-right: 1px solid #ddd;
    padding-right: 16px;
}

.metrics-card:last-child {
    border-right: none;
    padding-right: 0px;
}

.metrics-card p {
    margin-bottom: 0px;
    margin-top: 6px;
    font-size: 14px;
}

/* ---------------------------
TABS
--------------------------- */

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    padding: 0 10px;
}

.tab-button {
    flex: 1;
    padding: 10px 6px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.tab-button.active {
    border-bottom: 2px solid black;
    font-weight: 500;
}

.tab-button:hover {
    background: #f3f3f3;
}

/* ---------------------------
TAB CONTENT
--------------------------- */

.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tab-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
}

.tab-panel.active {
    display: block;
}

.tab-placeholder {
    padding: 20px;
    font-size: 12px;
    color: #777;
}

/* ---------------------------
PARAMETERS PANEL
--------------------------- */

.parameters-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.param-section h4 {
    font-size: 13px;
    margin-bottom: 12px;
}

/* Boundary row */

.boundary-row {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}

.slider-field {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.slider-field label {
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.slider-field label span {
    font-size: 12px;
    font-weight: 500;
    color: #222;
}

/* Single-handle track (boundary) */

.single-track {
    position: relative;
    height: 28px;
    margin-bottom: 2px;
    width: 100%;
    box-sizing: border-box;
}

.single-track .track-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 3px;
    background: #ddd;
    border-radius: 2px;
}

.single-track .track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 3px;
    background: #222;
    border-radius: 2px;
}

.single-track input[type=range] {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    margin: auto;
    height: 28px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
}

.single-track input[type=range]::-webkit-slider-runnable-track {
    height: 0;
}

.single-track input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #222;
    cursor: pointer;
    margin-top: -7px;
}

.single-track input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #222;
    cursor: pointer;
}

/* Dual-handle track (room areas) */

.room-block {
    margin-bottom: 18px;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.room-name {
    font-size: 13px;
    font-weight: 500;
    color: #222;
}

.room-range-val {
    font-size: 11px;
    color: #666;
}

.room-range-val span {
    color: #222;
    font-weight: 500;
}

.dual-track {
    position: relative;
    height: 28px;
    margin-bottom: 2px;
    width: 100%;
    box-sizing: border-box;
}

.dual-track .track-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 3px;
    background: #ddd;
    border-radius: 2px;
}

.dual-track .track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: #222;
    border-radius: 2px;
}

.dual-track input[type=range] {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    margin: auto;
    height: 28px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

.dual-track input[type=range]::-webkit-slider-runnable-track {
    height: 0;
}

.dual-track input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #222;
    pointer-events: all;
    cursor: pointer;
    margin-top: -7px;
}

.dual-track input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #222;
    pointer-events: all;
    cursor: pointer;
}

/* Shared bound/range labels */

.bound-labels,
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

/* Generate button */

#generate-layout {
    margin-top: 20px;
    width: 100%;
    padding: 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
}

#generate-layout:hover {
    background: #f3f3f3;
}

/* ---------------------------
REPOSITORY LINK
--------------------------- */

.repo-section {
    padding-bottom: 4px;
    max-width: 280px;
    color: #4a4a4a;
    font-size: 12px;
    line-height: 1.45;
    text-align: justify;
}

.repo-section h4 {
    margin-top: 0px;
    margin-bottom: 0px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.02em;
}

.repo-section p {
    margin-top: 0px;
}

.repo-button {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    background: white;
    font-size: 12px;
    text-decoration: none;
    color: #222;
}

.repo-button:hover {
    background: #f3f3f3;
}

/* ---------------------------
INFO PANEL
--------------------------- */

.info-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section p {
    font-size: 12px;
    color: #4a4a4a;
    line-height: 1.6;
    margin: 6px 0 10px 0;
    text-align: justify;
}

.info-tag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 4px;
}

.info-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.info-link {
    display: inline-block;
    font-size: 11px;
    color: #222;
    text-decoration: none;
    border: 1px solid #ccc;
    padding: 4px 10px;
    border-radius: 3px;
}

.info-link:hover {
    background: #f3f3f3;
}

/* ---------------------------
CANVAS LEGEND OVERLAY
--------------------------- */

.canvas-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.canvas-legend .legend-row {
    margin: 0;
    cursor: default;
}

.canvas-legend .legend-row:hover {
    font-weight: 400;
}

/* ---------------------------
LOADING OVERLAY
--------------------------- */

#loading-overlay {
    position: absolute;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#loading-overlay.hidden {
    display: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-floorplan {
    width: 160px;
    height: 107px;
    display: block;
}

/* Rooms pulse in staggered sequence */
.load-room {
    stroke: #333;
    stroke-width: 1;
    opacity: 0.15;
    animation: roomPulse 2.4s ease-in-out infinite;
}

.load-common { fill: #6fbf73; }
.load-private { fill: #5fa4e8; }

.load-room:nth-child(1) { animation-delay: 0.0s; }
.load-room:nth-child(2) { animation-delay: 0.2s; }
.load-room:nth-child(3) { animation-delay: 0.4s; }
.load-room:nth-child(4) { animation-delay: 0.6s; }
.load-room:nth-child(5) { animation-delay: 0.8s; }
.load-room:nth-child(6) { animation-delay: 1.0s; }
.load-room:nth-child(7) { animation-delay: 1.2s; }

@keyframes roomPulse {
    0%   { opacity: 0.15; }
    40%  { opacity: 0.85; }
    80%  { opacity: 0.15; }
    100% { opacity: 0.15; }
}

.loading-label {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    letter-spacing: 0.02em;
}

.loading-sub {
    font-size: 11px;
    color: #999;
    margin-top: -12px;
}
