

.panel-area {
    width: 90%;
    margin: 0 auto;
    background: #1a1a1a;
    height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
}

/* Control Voltage Strip */
.control-voltage-strip {
    position: sticky;
    top: -1px;
    left: 0;
    width: 100%;
    height: 50px;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #0f0;
    z-index: 100; /* Higher z-index to ensure it stays above all content */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Add shadow for better visual separation */
}

.strip-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strip-btn {
    background: #333;
    color: #fff;
    padding: 8px 16px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

/* Fixed width for RUN and LOOP buttons to prevent resizing on toggle */
#runstop-btn,
#loop-btn {
    min-width: 70px;
    text-align: center;
}

/* Active States */
.strip-btn.on {
    background: #0f0;
    color: #000;
}

.strip-btn.run {
    background: orange;
    color: #000;
}

.strip-btn.active {
    background: #0f0;
    color: #000;
}

/* Disabled State */
.strip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Title */
.strip-title {
    font-size: 18px;
    font-weight: bold;
    color: #0f0;
}

/* Dropdown Button */
.dropdown-btn {
    background: #111;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.dropdown-btn:hover {
    background: #0f0;
    color: #000;
}

/* Dropdown Container */
.cv-dropdown-container {
    display: none;
    height: 550px;
    max-height: 550px; /* Enforce maximum height */
    background: #111;
    color: #fff;
    border-top: 1px solid #0f0;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: px;
    border-radius: 0 0 4px 4px;
    overflow: visible; /* Allow content to extend when zooming */
    box-sizing: border-box;
}

.graph-ui {
    display: grid;
    grid-template-columns: 120px 100px 1fr; /* Controls, CVs, Graph */
    grid-template-rows: auto auto; /* Main content, Info section */
    gap: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 5px;
    background: #222;
    border-radius: 4px;
    height: 100%; /* Fill container height */
    max-height: 100%; /* Don't exceed container */    
    overflow: visible; /* Allow content to extend for time axis labels */
    box-sizing: border-box;
}

.graph-controls-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px;
    background: #333;
    border-radius: 4px;
}

.graph-cvs {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px;
    background: #333;
    border-radius: 4px;
}

.graph-main {
    grid-column: 3;
    grid-row: 1 / 3; /* Span both rows */
}

.graph-info {
    grid-column: 1 / 3; /* Span across controls and CVs columns only */
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
    margin-top: 5px;
    box-sizing: border-box;
}

.info-content {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.info-content h4 {
    margin: 0 0 8px 0;
    color: #0f0;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid #0f0;
    padding-bottom: 4px;
}

.info-content p {
    margin: 0 0 8px 0;
    color: #ccc;
    font-style: italic;
    font-size: 11px;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Timeline Control Sections */
.timeline-control-sections {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 40px;
}

/* Toggle Switch Styling */
.toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.toggle-label {
    font-size: 11px;
    color: rgb(255, 255, 255);
    font-weight: bold;
    text-align: center;
    padding-bottom: 5px;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-input:checked + .toggle-slider {
    background: #0f0;
    border-color: #0f0;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #000;
}

.info-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.info-details span {
    color: #fff;
    font-size: 10px;
    padding: 1px 0;
    flex: 1;
    white-space: nowrap;
}

.info-details strong {
    color: #0f0;
    font-weight: bold;
    min-width: 35px;
    display: inline-block;
}

.sec-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sec-btn {
    width: 80px;
    height: 30px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.sec-btn:hover {
    background: #444;
    transform: scale(1.05);
}
.volt-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volt-btn {
    width: 80px;
    height: 30px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.volt-btn:hover {
    background: #444;
    transform: scale(1.05);
}

.arrow-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.arrow-btn {
    width: 25px;
    height: 15px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.3s;
}

.arrow-btn:hover {
    background: #0f0;
    color: #000;
}

/* New input with arrows styles */
.input-with-arrows {
    position: relative;
    width: 80px;
    height: 30px;
}

.sec-input, .volt-input {
    width: 100%;
    height: 100%;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0 25px 0 8px;
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.sec-input::-webkit-outer-spin-button,
.sec-input::-webkit-inner-spin-button,
.volt-input::-webkit-outer-spin-button,
.volt-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sec-input:focus, .volt-input:focus {
    border-color: #0f0;
    background: #444;
}

.input-arrows {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.input-arrows .arrow-btn {
    width: 20px;
    height: 12px;
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 2px;
    cursor: pointer;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.input-arrows .arrow-btn:hover {
    background: #0f0;
    color: #000;
}

.input-arrows .arrow-btn.up {
    border-bottom: none;
    border-radius: 2px 2px 0 0;
}

.input-arrows .arrow-btn.down {
    border-top: none;
    border-radius: 0 0 2px 2px;
}

.input-label {
    font-size: 11px;
    color: #aaa;
    font-weight: bold;
    margin-left: 3px;
}

/* Tool Buttons Container */
.tool-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* Tool Button Styling */
.tool-btn {
    flex: 1;
    padding: 4px 6px;
    background: #131212;
    color: #0f0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    min-height: 30px;
}

.tool-btn:hover {
    background: #3a3a3a;
    border-color: #0f0;
    transform: scale(1.05);
}

.tool-btn:active {
    background: #0f0;
    color: #000;
}

.marquee-btn.active {
    background: #0f0;
    color: #000;
    border-color: #0f0;
}

.blank-btn, .blank-btn2 {
    opacity: 0.5;
    cursor: default;
}

.blank-btn:hover, .blank-btn2:hover {
    background: #2a2a2a;
    border-color: #555;
    transform: none;
}

.action-btn, .cv-btn, .add-btn, .view-all-btn, .graph-cv-add-btn {
    padding: 8px 12px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.action-btn:hover, .cv-btn:hover, .add-btn:hover, .view-all-btn:hover, .graph-cv-add-btn:hover {
    background: #444;
    transform: scale(1.05);
}

.add-btn {
    background: #0f0;
    color: #000;
    font-weight: bold;
}

.add-btn:hover {
    background: #00cc00;
}

.graph-cv-add-btn {
    background: #00E897;
    color: #000;
    font-weight: bold;
}

.graph-cv-add-btn:hover {
    background: #00d182;
    transform: scale(1.05);
}

.undo-btn {
    background: #007bff;
    color: #fff;
    font-weight: bold;
}

.undo-btn:hover {
    background: #0056b3;
}

.redo-btn {
    background: #17a2b8;
    color: #fff;
    font-weight: bold;
}

.redo-btn:hover {
    background: #138496;
}

.view-all-btn {
    background: #0c0c0c;
    color: #fff;
    font-weight: bold;
}

.view-all-btn:hover {
    background: #424242;
}

.view-all-btn.active {
    background: #020072;
    
}



.copy-btn {
    background: #004f99; /* Dark yellow */
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #004f99;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
}

.copy-btn:hover {
    background: #0169ca; /* Lighter dark yellow on hover */
}

.copy-btn.active {
    background: #0169ca; /* Darker yellow when active */
}

.paste-all-btn {
    background: #004f99; /* Dark yellow */
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #004f99;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    min-width: 80px;
}

.paste-all-btn:hover {
    background: #0169ca; /* Lighter dark yellow on hover */
}

.paste-all-btn.active {
    background: #0169ca; /* Darker yellow when active */
}

.duplicate-btn {
    background: #518d03; /* Dark green */
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #518d03;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
}

.duplicate-btn:hover {
    background: #69b802; /* Lighter dark green on hover */
}

.duplicate-btn.active {
    background: #69b802; /* Darker green when active */
}

.paste-btn {
    background: #518d03; /* Dark green */
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border: 1px solid #518d03;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    min-width: 80px;
}

.paste-btn:hover {
    background: #69b802; /* Lighter dark green on hover */
}

.paste-btn.active {
    background: #69b802 /* Darker green when active */
}

.graph-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #222;
    border-radius: 4px;
    border: 1px solid #444;
    position: relative;
}

/* Vertical grid lines for time axis */
.graph-vertical-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.vertical-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #444;
    opacity: 0.6;
    pointer-events: none;
}

.vertical-grid-line.major {
    background-color: #666;
    opacity: 0.8;
    width: 1px;
}

.vertical-grid-line.minor {
    background-color: #333;
    opacity: 0.4;
    width: 1px;
}

.graph-top-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    background: #292929;
    border-radius: 4px;
    border: 1px solid #333;
    flex-wrap: wrap;
}

.nav-btn, .select-all-btn, .copy-btn, .seq-btn {
    padding: 5px 10px;
    background: #444;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    min-width: 20px;
}

.select-all-btn {
    min-width: 90px;
    background: #1a5f9a; /* Blue background */
    border-color: #1a5f9a;
}

.select-all-btn:hover {
    background: #2578c4; /* Lighter blue on hover */
}

.copy-btn {
    min-width: 60px;
    background: #0a8f0a; /* Green background */
    border-color: #0a8f0a;
}

.copy-btn:hover {
    background: #0db00d; /* Lighter green on hover */
}

.seq-btn {
    min-width: 50px;
    background: #967b03; /* Green background - same as COPY */
    border-color: #967b03;
}

.seq-btn:hover {
    background: #dfb602; /* Lighter green on hover */
}

.seq-btn.active {
    background: #0a6f0a; /* Darker green when active */
}

.seq-section {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a1a; /* Dark background */
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    margin: 0 8px;
}

.separator {
    color: #666;
    font-size: 18px;
    font-weight: bold;
    padding: 0 8px;
    user-select: none;
}

.nav-btn:hover {
    background: #555;
}

.nav-btn.active {
    background: #000;
}

/* View All button in top controls */
.graph-top-controls .view-all-btn {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 12px;
}

.small-input {
    width: 60px;
    text-align: center;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px;
}

.small-input:focus {
    border-color: #0f0;
    outline: none;
}

.paste-target-select {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    min-width: 100px;
}

.paste-target-select:hover {
    border-color: #0f0;
}

.paste-target-select:focus {
    border-color: #0f0;
    outline: none;
}

.zoom-go-btn {
    background: #06F838;
    color: #000;
    font-weight: bold;
    padding: 4px 8px;
    border: 1px solid #06F838;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 12px;
}

.zoom-go-btn:hover {
    background: #04D62F;
    border-color: #04D62F;
}

.zoom-go-btn:active {
    background: #03B228;
    border-color: #03B228;
}

.zoom-slider {
    width: 120px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(to right, #0f0, #444);
    border-radius: 3px;
    outline: none;
    transition: background 0.3s;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ff4444;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.graph-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* Allow wrapping when CV titles overflow */
    overflow-x: auto;
    overflow-y: auto; /* Add vertical scrolling for overflow */
    padding: 10px;
    background: #222;
    border-radius: 4px;
    border: 1px solid #333;
    border-top: 2px solid #0f0;
    min-height: 89px;
    max-height: 89px; /* Limit height to prevent container expansion */
    box-sizing: border-box;
    
}

.cv-tile {
    border: 1px solid #444;
    background: #333;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 100px;
    height: 60px;
    text-align: center;
    border-radius: 4px;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.cv-tile:hover {
    background: #444;
}

/* Selected CV tile styling */
.cv-tile.selected {
    border-color: #ff0 !important;
    background: #444 !important;
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

.cv-top {
    display: flex;
    justify-content: space-between;
    padding: 4px;
    background: #222;
    border-radius: 4px 4px 0 0;
}

.cv-title-btn {
    flex: 1;
    font-size: 12px;
    padding: 4px;
    border: 1px solid #555;
    background: #333; /* Default fallback */
    color: #fff;
    cursor: pointer;
    border-radius: 2px;
    transition: opacity 0.3s, transform 0.3s;
}

.cv-title-btn:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Custom color override for CV title buttons */
.cv-title-btn[style*="background-color"] {
    background: var(--custom-bg) !important;
}

.cv-title-btn[style*="background-color"]:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Specific CV type colors */
.cv-title-btn.cv-trig {
    background-color: #f0e00b !important;
    color: #000 !important;
}

.cv-title-btn.cv-gate {
    background-color: #0ff !important;
    color: #000 !important;
}

.cv-title-btn.cv-curv {
    background-color: #ff8800 !important;
    color: #000 !important;
}

.cv-title-btn.cv-log {
    background-color: #8800ff !important;
    color: #fff !important;
}

.cv-title-btn.cv-exp {
    background-color: #ff0080 !important;
    color: #fff !important;
}

.cv-title-btn.cv-ran {
    background-color: #80ff00 !important;
    color: #000 !important;
}

.close-btn {
    width: 20px;
    height: 25px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #333;
    border-color: #555;
}

.cv-bottom {
    display: flex;
    justify-content: space-around;
    font-size: 11px;
    padding: 4px;
    background: #222;
    border-radius: 0 0 4px 4px;
    color: #ccc;
}

.cv-placeholder {
    white-space: nowrap;
    font-style: italic;
    padding: 20px 10px;
    color: #888;
    height: 60px;
    display: flex;
    align-items: center;
    min-height: 60px;
    box-sizing: border-box;
}

/* Custom Scrollbar for graph-bottom */
.graph-bottom::-webkit-scrollbar {
    height: 8px;
}

.graph-bottom::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.graph-bottom::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.graph-bottom::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* EXP Control Point Context Menu */
#exp-context-menu {
    position: fixed;
    background: #333;
    border: 2px solid #0f0;
    border-radius: 6px;
    padding: 8px;
    z-index: 1000;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#exp-context-menu > div {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    font-weight: bold;
}

#exp-context-menu > div:hover {
    background: #0f0;
    color: #000;
}

#exp-context-menu > div:active {
    background: #00cc00;
}

/* Graph Tooltip */
.graph-tooltip {
    position: fixed;
    background: rgba(34, 34, 34, 0.95);
    border: 0px solid #0f0;
    border-radius: 4px;
    padding: 6px 10px;
    z-index: 1001;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: none;
}

.graph-tooltip .tooltip-time {
    color: #0f0;
    margin-right: 8px;
}

.graph-tooltip .tooltip-voltage {
    color: #fff;
}
