* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    margin: 0 auto;
    padding: 10px;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    overflow: hidden;
}

.settings-header {
    background: #e0e0e0;
    padding: 5px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-content {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    /* justify-content: flex-start;  Left-justify elements */
    gap: 10px;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: stretch;
}

.settings-content.collapsed {
    display: none;
}

.setting-group {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background: #f9f9f9;
}

h3 {
    margin-bottom: 10px;
}

.setting-group h3 {
    margin-bottom: 10px;
    color: #d32f2f;
    font-size: 14px;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.form-row > :first-child {
    margin-right: auto; /* places the first child to the left */
}

.form-row label {
    max-width: 150px;
    min-width: 60px;
    font-size: 12px;
    color: #0e0e0e;
}

.form-row input[type="number"] {
    width: 80px; /* Fixed width  */
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.form-row select {
    width: 200px; /* Fixed width  */
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

#Scr-aspect-ratio {
    width: 105px;
}

.form-row .unit {
    margin-left: 5px;
    font-size: 11px;
    color: #333333;
    min-width: 20px;
}

.form-row .light-unit {
    margin-left: 5px;
    font-size: 11px;
    color: #333333;
    min-width: 20px;
}

#units-select {
    width: 73px;
}

.priority-switch {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.priority-switch label {
    display: flex;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
}

.priority-switch input[type="radio"] {
    margin-right: 5px;
}

/* Settings Sub-section - Minimum width to accommodate elements*/
.setting-group:nth-child(1) { /*Proj selector*/
    max-width: 450px;
    min-width: 320px;
}
.setting-group:nth-child(2) { /*Proj settings*/
    max-width: 500px;
    min-width: 400px;
}
.setting-group:nth-child(3) { /*Screen*/
    max-width: 400px;
    min-width: 300px;
}
.setting-group:nth-child(4) { /*Room*/
    max-width: 300px;
    min-width: 200px;
}
.setting-group:nth-child(5) { /*Settings*/
    max-width: 320px;
    min-width: 300px;
}
/* Drawing Section */
.drawing-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    padding: 10px;
    padding-top: 5px;
}

.views-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.view-container {
    position: relative;
    /* touch-action: none; */
    overflow: hidden;
}

.view-title {
    text-align: center;
    color: #d32f2f;
    margin-bottom: 5px;
    font-size: 14px;
}

/* Additional Information Section */
.additional-info {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.info-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.info-item.projector-info {
    display: flex;
    flex-direction: column;
    align-items:flex-start;
    text-align: center; 
    /* min-width: 400px; */
    max-width: 1250px
}

.info-item.projection-efficiency {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: center;
    align-content: flex-start;
    flex-wrap: wrap;
}

.model-lens-info {
    width: 100%; 
    margin-bottom: 10px;
}

.info-item h4 {
    color: #d32f2f;
    margin-bottom: 5px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 800px) {
    .views-container {
        grid-template-columns: 1fr;
    }
    .settings-content {
        flex-direction: column; /* Stack vertically */
        align-items: stretch; /* Full width items */
    }
    .setting-group {
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* Draggable elements */
.draggable {
    cursor: move;
    transition: all 0.2s ease;
}

.draggable:hover {
    stroke: #ff0000;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
    stroke-width: 3px !important;
}

.screen-highlight {
    stroke: #ffcc00 !important;
    stroke-width: 4px !important;
}

.screen-hit-area {
    pointer-events: all;
}

.screen-hit-area:hover + [class*="screen"] {
    stroke: #ffcc00;
    stroke-width: 4px;
}

/* Language and unit controls */
.controls-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-group label {
    font-size: 12px;
    color: #0e0e0e;
}

.control-group select {
    padding: 3px 5px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Error messages */
.error {
    color: #d32f2f;
    font-size: 11px;
    margin-top: 2px;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #0e0e0e;
}

.form-row input[type="range"] {
    width: 120px;
    margin-right: 10px;
}

/* Drawing Canvas */
.drawing-canvas {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: 600px;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: default;
}

.drawing-canvas .draggable:hover {
    cursor: grab;
}

.drawing-canvas .draggable:active {
    cursor: grabbing;
}

/* Priority toggle styling */
.priority-switch.toggle-switch {
    display: flex;
    justify-content: start;
    gap: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    width: fit-content;
    margin-top: 5px;
}

.priority-switch.toggle-switch {
    width: 100%;
    display: flex;
}

.priority-switch.toggle-switch > * {
    flex: 1; 
}

.priority-switch.toggle-switch input[type="radio"] {
    display: none;
}

.priority-switch.toggle-switch label {
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #eee;
    border-right: 1px solid #ccc;
    user-select: none;
}

.priority-switch.toggle-switch label:last-child {
    border-right: none;
}

.priority-switch.toggle-switch input[type="radio"]:checked + label {
    background-color: #d32f2f;
    color: white;
}

.projector-image-container {
    flex: 0 0 auto;
    text-align: center;
    width: 200px;
}

#projector-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

.info-item p {
    /* margin: 10px 0; */
    font-size: 16px;
    color: #000000;
    text-align: center;
}

.projector-info {
    display: flex;
    /* gap: 15px; */
}

.projector-image-container img {
    max-width: 300px;
    max-height: 300px;
    object-fit: contain;
}

.projector-details-content {
    display: flex;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content:center;
}

.projector-details {
    flex: 1;
    min-width: 300px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    table-layout: fixed;
}

.info-table td {
    padding-bottom: 3px;
    font-size: 14px;
    white-space: normal;
}

.info-table td.label {
    width: 65%;
    text-align: right;
    padding-right: 5px;
    color: #0e0e0e;
    white-space: normal; /* nowrap */
}

.info-table td.value {
    width: 35%;
    text-align: left;
    padding-left: 5px;
    color: #0e0e0e;
}

.info-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 15px;
}

#low-contrast-warning-sign {
    color: red;
    cursor: pointer;
    margin-left: 20px;
    margin-bottom: 5px;
    font-size: 14px;
}

#low-contrast-warning-popup {
    color: red;
    background-color: #f6f6f6;
    border: 2px solid red;
    border-radius: 10px;
    padding: 15px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    box-shadow: 5px 10px 10px 5px rgba(0, 0, 0, 0.66);
    animation: fadeInOut 5s ease-out forwards;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

#low-contrast-warning-popup.show {
    visibility: visible;
    opacity: 1;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        visibility: visible;
    }
    1%, 50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.contrast-label-label {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .info-grid {
        grid-template-columns: 1.3fr 1fr 1.2fr;
    }
    
    .projector-info {
        grid-column: span 3;
    }
}

@media (max-width: 1020px) {
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .projector-info {
        grid-column: span 2;
    }
}

@media (max-width: 780px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .projector-info {
        grid-column: span 1;
    }
}

@media print {
    .settings-section {
        display: none !important;
    }
     #main-title {
        display: none !important;
    }
}