/* Aimed Research Setup Calculator - Dark Theme Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    background-color: #1a1a1a;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Main Container */
.calculator-container {
    background-color: #2d2d2d;
    border: 2px solid #555;
    border-radius: 4px;
    width: 750px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Header / Tabs */
.calculator-header {
    background-color: #3d3d3d;
    padding: 8px 15px;
    border-bottom: 1px solid #555;
}

.tab {
    display: inline-block;
    background-color: #e8e8e8;
    color: #000;
    padding: 6px 15px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 500;
}

.tab.active {
    background-color: #f5f5f5;
}

/* Calculator Body */
.calculator-body {
    display: flex;
    background-color: #f0f0f0;
    padding: 15px;
    gap: 20px;
}

/* Left Column - Inputs */
.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Input Rows */
.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.input-row label {
    width: 115px;
    text-align: right;
    font-weight: 500;
    flex-shrink: 0;
}

/* First row with lookup button - adjust label width */
.input-row .lookup-btn + label {
    width: 95px;
}

.input-row input[type="number"],
.input-row select {
    height: 24px;
    padding: 2px 6px;
    border: 1px solid #999;
    border-radius: 2px;
    background-color: #fff;
    font-size: 12px;
}

.input-row input[type="number"] {
    width: 70px;
}

.input-row input[type="number"].small-input {
    width: 60px;
}

.input-row input[type="number"].tiny-input {
    width: 40px;
}

.input-row select {
    width: 100px;
}

.label-right {
    font-size: 11px;
    color: #333;
}

.separator {
    font-weight: bold;
}

/* Display Values (read-only outputs in left column) */
.display-value {
    display: inline-block;
    min-width: 80px;
    height: 24px;
    line-height: 22px;
    padding: 0 6px;
    background-color: #e8e8e8;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 12px;
}

/* Slider Rows */
.slider-row {
    margin: 4px 0;
}

.slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #7070a0, #a0a0d0);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a4a6a;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a4a6a;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

/* RAM Row */
.ram-row {
    flex-wrap: nowrap;
}

.ram-label {
    font-size: 10px;
    color: #333;
    white-space: nowrap;
}

/* Special Accessories Button */
.accessory-btn {
    background-color: #e0e0e0;
    border: 1px solid #999;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 11px;
    cursor: pointer;
    line-height: 1.3;
    margin-left: auto;
}

.accessory-btn:hover {
    background-color: #d0d0d0;
}

/* Right Column - Outputs */
.right-column {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Output Section */
.output-section {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
}

.output-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}

.output-label {
    color: #000;
}

.output-value {
    font-weight: 500;
}

/* Colored output values matching LabVIEW */
#teleconverter, #closeupLens {
    color: #0066cc;
}

#depthOfField, #nearFocus, #farFocus {
    color: #006600;
}

#pixelBlur {
    color: #cc0000;
}

/* Logo Section */
.logo-section {
    text-align: right;
    padding: 10px 5px;
}

.logo-image {
    max-width: 200px;
    height: auto;
}

/* Recording Section */
.recording-section {
    background-color: #ffffd0;
    border: 1px solid #cc9;
    border-radius: 4px;
    padding: 10px;
}

.recording-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 11px;
}

.recording-label {
    color: #333;
}

.recording-value {
    font-weight: 500;
    color: #000;
}

/* Info Text */
.info-text {
    background-color: #ffffd0;
    border: 1px solid #cc9;
    border-radius: 4px;
    padding: 8px;
    font-size: 10px;
    color: #660000;
    line-height: 1.4;
}



/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #f0f0f0;
    border: 2px solid #555;
    border-radius: 4px;
    width: 400px;
    max-width: 90%;
}

.modal-content.modal-small {
    width: 350px;
}

.modal-header {
    background-color: #3d3d3d;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: bold;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6666;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    background-color: #d0d0d0;
    border-bottom: 1px solid #999;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    border-right: 1px solid #999;
}

.modal-tab:last-child {
    border-right: none;
}

.modal-tab.active {
    background-color: #f0f0f0;
}

.modal-tab:hover:not(.active) {
    background-color: #e0e0e0;
}

/* Modal Body */
.modal-body {
    padding: 15px;
}

.accessory-content {
    display: none;
}

.accessory-content.active {
    display: block;
}

.accessory-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accessory-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.accessory-options input[type="radio"] {
    cursor: pointer;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-input {
    width: 60px;
    height: 24px;
    padding: 2px 6px;
    border: 1px solid #999;
    border-radius: 2px;
}

/* Advanced Settings */
.advanced-setting {
    margin-bottom: 15px;
}

.advanced-setting label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.advanced-setting input {
    width: 100px;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 13px;
}

.setting-help {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
    font-style: italic;
}

.slider-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.opacity-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, transparent, #333);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    border: 1px solid #999;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a4a6a;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a4a6a;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#tooltipOpacityValue {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
}

/* Apply Button */
.apply-btn {
    display: block;
    width: calc(100% - 30px);
    margin: 15px;
    padding: 10px;
    background-color: #4a4a6a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.apply-btn:hover {
    background-color: #5a5a7a;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background-color: rgba(51, 51, 51, var(--tooltip-opacity, 0.85));
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 300px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1.4;
    backdrop-filter: blur(2px);
}

.tooltip.visible {
    opacity: 1;
}

/* Custom Aperture Row */
.custom-aperture-row {
    padding-left: 128px;
}

/* Make container relative for button positioning */
.calculator-container {
    position: relative;
}

/* Lookup Camera Button */
.lookup-btn {
    background-color: #8a4f1c;
    color: #fff;
    border: 1px solid #5e350f;
    border-radius: 4px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    cursor: pointer;
    line-height: 1.2;
    flex: 1 1 100%;
    width: 100%;
}

.lookup-btn:hover {
    background-color: #a8632a;
}

/* Aperture Input */
.aperture-input {
    width: 70px;
}

/* Wider inputs for unit alignment */
.input-row input.wide-input,
.input-row .display-value.wide-input {
    width: 100px;
    min-width: 100px;
}

/* Unit dropdown alignment */
.input-row select.unit-dropdown {
    width: 120px;
    min-width: 120px;
}

/* Camera Modal */
.modal-large {
    width: 550px;
    max-width: 95%;
}

/* Camera Filters */
.camera-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.camera-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.camera-filters label {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.camera-filters select {
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 12px;
    min-width: 150px;
}

.camera-filters input {
    flex: 1;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
    min-width: 150px;
}

.camera-search {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.camera-search input {
    flex: 1;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
}

.camera-list-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 15px;
}

.camera-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.camera-table th,
.camera-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.camera-table th {
    background-color: #e0e0e0;
    position: sticky;
    top: 0;
}

.camera-table tr:hover {
    background-color: #f5f5f5;
}

.camera-table .select-btn {
    background-color: #4a4a6a;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.camera-table .select-btn:hover {
    background-color: #5a5a7a;
}

.camera-table .delete-btn {
    background-color: #a04040;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
}

.camera-table .delete-btn:hover {
    background-color: #b05050;
}

.add-camera-section {
    border-top: 1px solid #ccc;
    padding-top: 15px;
}

.add-camera-section h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.add-camera-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.add-camera-form input {
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 12px;
}

.add-camera-form input[type="text"] {
    width: 110px;
}

.add-camera-form input[type="number"] {
    width: 90px;
}

.add-camera-form select {
    height: 28px;
    padding: 4px 6px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 11px;
}

.add-btn {
    background-color: #4a6a4a;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.add-btn:hover {
    background-color: #5a7a5a;
}

/* Harmonic Focus Tab */
.harmonic-tab {
    display: none;
    flex-direction: column;
    padding: 30px;
}

.harmonic-tab.active {
    display: flex;
}

.harmonic-content {
    max-width: 600px;
    margin: 0 auto;
}

.harmonic-inputs {
    margin-bottom: 30px;
}

.harmonic-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.harmonic-row label {
    width: 140px;
    font-weight: 600;
    font-size: 14px;
}

.harmonic-row input {
    width: 80px;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 14px;
}

.harmonic-result {
    display: inline-block;
    width: 80px;
    height: 28px;
    line-height: 26px;
    padding: 0 8px;
    background-color: #e8e8e8;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
}

.harmonic-diagram {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    margin: 30px 0;
    padding: 25px;
    background-color: #e8e8e8;
    border-radius: 4px;
}

/* Camera Illustration */
.camera-illustration {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.camera-main {
    position: relative;
}

.camera-viewfinder {
    position: absolute;
    top: -12px;
    left: 10px;
    width: 25px;
    height: 15px;
    background: linear-gradient(to bottom, #333, #555);
    border-radius: 3px 3px 0 0;
    border: 1px solid #222;
    border-bottom: none;
}

.camera-body-box {
    width: 70px;
    height: 55px;
    background: linear-gradient(to bottom, #444, #333, #222);
    border-radius: 5px;
    border: 2px solid #111;
    position: relative;
    display: flex;
    align-items: center;
}

.camera-grip {
    position: absolute;
    left: -8px;
    top: 5px;
    width: 12px;
    height: 45px;
    background: linear-gradient(to right, #555, #444, #333);
    border-radius: 4px 0 0 4px;
    border: 1px solid #222;
    border-right: none;
}

.camera-screen {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 18px;
    background: #1a1a2e;
    border: 1px solid #111;
    border-radius: 2px;
}

/* Lens Assembly - pointing right toward the bars */
.camera-lens-assembly {
    display: flex;
    align-items: center;
    margin-left: -2px;
}

.lens-mount {
    width: 8px;
    height: 40px;
    background: linear-gradient(to bottom, #666, #888, #666);
    border: 1px solid #444;
}

.lens-barrel {
    width: 45px;
    height: 38px;
    background: linear-gradient(to bottom, #555, #777, #888, #777, #555);
    border-radius: 3px;
    border: 1px solid #333;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.lens-ring {
    width: 4px;
    height: 42px;
    background: linear-gradient(to bottom, #444, #666, #444);
    border-radius: 1px;
}

.lens-front {
    width: 12px;
    height: 32px;
    background: linear-gradient(to bottom, #666, #999, #aaa, #999, #666);
    border-radius: 0 4px 4px 0;
    border: 1px solid #444;
    border-left: none;
    position: relative;
}

.lens-front::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 20px;
    background: radial-gradient(ellipse, #2a4a6a, #1a2a3a);
    border-radius: 2px;
    border: 1px solid #111;
}

/* Focus Bars */
.focus-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    max-width: 280px;
}

.focus-bar {
    height: 18px;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 20px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.near-bar {
    width: 50%;
    background: linear-gradient(to right, #90EE90, #32CD32, #228B22);
}

.focus-bar-main {
    width: 66%;
    background: linear-gradient(to right, #FFD700, #FFA500, #FF8C00);
}

.far-bar {
    width: 100%;
    background: linear-gradient(to right, #90EE90, #32CD32, #228B22);
}

.harmonic-info {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    font-size: 13px;
    line-height: 1.5;
}

.harmonic-info p {
    margin-bottom: 10px;
}

.harmonic-info p:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .calculator-body {
        flex-direction: column;
    }

    .right-column {
        width: 100%;
    }

    .calculator-container {
        width: 100%;
    }
}
