body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
    color: #333;
}

.app-container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    align-self: flex-start;
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.toolbar-group:last-child {
    border-bottom: none;
}

.tool-btn {
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tool-btn i {
    font-size: 1.2em;
    margin: 0;
}

.tool-btn:hover {
    background-color: #e9ecef;
    color: #3498db;
}

.tool-btn:hover::after {
    content: attr(title);
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #343a40;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-btn:disabled:hover {
    background-color: transparent;
    color: #495057;
    z-index: 1000;
}

.tool-btn.active {
    color: #3498db;
    background-color: #e9ecef;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    overflow-y: auto;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.input-section {
    background-color: white;
    border-radius: 8px;
}

.input-section h2 {
    color: #2c3e50;
    margin-top: 0px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.input-section h2 i {
    margin-right: 10px;
    color: #3498db;
}

.input-section h3 {
    color: #34495e;
    margin-top: 0px;
    font-size: 1.1em;
}

.input-section h3 i {
    margin-right: 8px;
    color: #3498db;
}

.input-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.input-field {
    margin-top: 15px;
}

.input-field label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 10px;
    color: #6c757d;
    width: 20px;
    text-align: center;
}

.input-with-icon input,
.input-with-icon select {
    padding: 8px 8px 8px 35px;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

/* Button Styles */
.action-buttons,
.additional-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

button {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

button i {
    margin-right: 8px;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.secondary-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #ced4da;
}

.secondary-btn:hover {
    background-color: #e9ecef;
}

.tertiary-btn {
    background-color: #e9ecef;
    color: #495057;
}

.tertiary-btn:hover {
    background-color: #dee2e6;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Custom Distances Section */
.custom-distances {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.custom-distances .input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: none;
    border: none;
    padding: 0;
}

/* Visualization Section */
.visualization {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.visualization-container {
    display: flex;
    gap: 20px;
}

#room {
    position: relative;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    margin: 0 auto;
    transition: all 0.3s;
    flex: 1;
    aspect-ratio: 5/4;
}

.grid-line {
    position: absolute;
    background-color: rgba(200, 200, 200, 0.5);
}

.toggle-container {
    margin-top: 10px;
}

.measurement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.measurement-line {
    position: absolute;
    background-color: rgba(0, 0, 255, 0.6);
    z-index: 5;
}

.grid-coordinate {
    position: absolute;
    font-size: 10px;
    color: #666;
    z-index: 2;
}

.light-info {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    font-size: 12px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-width: 100px;
}

.wall-measurement {
    position: absolute;
    background-color: rgba(200, 200, 200, 0.7);
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #333;
}

.control-buttons {
    margin-top: 10px;
}

.manual-mode-buttons {
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: none;
}

.delete-btn {
    background-color: #ff4d4d;
}

.delete-btn:hover {
    background-color: #ff3333;
}

.add-btn {
    background-color: #4d79ff;
}

.add-btn:hover {
    background-color: #3366ff;
}

.selected {
    box-shadow: 0 0 15px rgba(255, 0, 0, 1);
    z-index: 20;
}

.light {
    position: absolute;
    border-radius: 50%;
    background-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #333;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

.light[data-custom="true"] {
    background-color: #ff9500;
    box-shadow: 0 0 10px rgba(255, 149, 0, 0.7);
}

.dimension-label {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
    z-index: 9;
    transform: translate(-50%, -50%);
}

.measurement-text {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 8;
    color: #333;
    transform: translate(-50%, -50%);
}

.light-info {
    z-index: 20;
}

.light.dragging {
    opacity: 0.7;
    z-index: 50;
}

.light-info {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    z-index: 30;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 120px;
}

.instructions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.instructions-box {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 80%;
}

.instructions-box ul {
    margin: 10px 0;
    padding-left: 20px;
}

.instructions-box button {
    margin-top: 15px;
}

.alignment-guide {
    position: absolute;
    background-color: rgba(255, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

.alignment-guide.horizontal {
    width: 100%;
    height: 1px;
}

.alignment-guide.vertical {
    width: 1px;
    height: 100%;
}

.ghost-measurement-overlay {
    opacity: 0.7;
    pointer-events: none;
    z-index: 25;
}

.room-dimensions-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-dimensions-container .input-with-icon {
    flex: 1;
}

.dimension-separator {
    font-size: 1.5em;
    color: #3498db;
    font-weight: bold;
    margin: 0 5px;
    padding-top: 8px;
    user-select: none;
}

.room-size label {
    margin-bottom: 12px;
}