body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
}

.main-panel {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: auto;
}

.scene-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
}

.price-estimator {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    width: 100%;
    max-width: 648px !important;
    display: flex;
}

.price-estimator h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.price-estimator-header {
  width: 35%;
  display: flex;
  flex-direction: column;
}

.price-estimator-details {
  width: 55%;
  display: flex;
  flex-direction: column;
}

.price-total {
    font-size: 32px;
    font-weight: bold;
    color: #2c5f2d;
    margin-bottom: 15px;
}

.price-breakdown {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    columns: 2;
}

.price-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

.price-breakdown-item:last-child {
    border-bottom: none;
}

.price-breakdown-item-name {
    color: #495057;
}

.price-breakdown-item-price {
    color: #2c5f2d;
    font-weight: 500;
}

.schedule-installation {
  margin-top: 10px;
  width: 170px;
  padding: 10px;
  background-color: #ff8800;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.schedule-installation:hover {
  background-color: #45a049;
}

.installation {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    max-width: 648px;
    width: 100%;
}

.installation h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.installation-input input {
    width: 627px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.installation-input button {
    width: 100%;
    padding: 12px;
    background-color: #2c5f2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.installation-input button:hover {
    background-color: #1e4620;
}

.installation-result {
    padding: 10px 0;
}

.installation-loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.installation-recommendation {
    line-height: 1.6;
    color: #333;
}

.installation-recommendation button {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.installation-recommendation button:hover {
    background-color: #5a6268;
}

.scene-container img {
    width: 100%;
    display: block;
    position: relative;
    z-index: 1;
}

.door-area {
    position: absolute;
    /* left, top, width, height are set dynamically by JavaScript based on scene */
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    grid-template-columns: repeat(4, 1fr);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    z-index: 2;
}

/* Layers inside the door area */
.door-base,
.door-panels,
.door-windows,
.door-hardware,
.door-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.door-base {
    z-index: 1;
}

.door-panels {
    z-index: 2;
}

.door-windows {
    z-index: 3;
    pointer-events: none;
}

.door-hardware {
    z-index: 4;
    pointer-events: none;
}

/* HANDLE LAYER:
 Size is controlled ONLY by CSS via variables.
 JS will position (left/top); width/height come from these classes. */
.door-handle {
    z-index: 5;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    width: var(--handle-w, 6%);
    height: var(--handle-h, 18%);
}

/* Per-handle-type defaults (responsive because they're % of .door-area) */
.handle--ring {
    --handle-w: 6%;
    --handle-h: 14%;
}

.handle--t {
    --handle-w: 6%;
    --handle-h: 20%;
}

.handle--pull {
    --handle-w: 6%;
    --handle-h: 28%;
}

/* Optional: Per-scene CSS overrides (examples) */
.scene-3 .door-handle.handle--ring {
    --handle-w: 6.5%;
    --handle-h: 18.5%;
}

.scene-2 .door-handle.handle--pull {
    --handle-w: 4.5%;
    --handle-h: 30%;
}

/* Dev overlay (kept from original, still off) */
.door-windows-overlay {
    position: absolute;
    border: 3px solid red;
    background: rgba(255, 0, 0, 0.2);
    left: 1%;
    top: 2.5%;
    width: 97%;
    height: 20%;
    display: none;
}

/* Sidebar */
.sidebar {
    min-width: 300px;
    max-width: 350px;
}

.selectors {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 300px;
}

  .control-heading {
    font-size: 18px;
    font-weight: bold;
    color: #272727;
    margin: 10px 0 0 0;
  }

  .selectors select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  select {
    padding: 8px 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    border: 1px solid #272727;
    background-color: white;
    cursor: pointer;
    width: 200px;
  }
  select:focus {
    outline: none;
    border-color: #4caf50;
  }

  label {
    margin-top: 10px;
  }

  .visual-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 0 0 0;
  }

  .visual-selector.window-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .visual-option {
    cursor: pointer;
    position: relative;
  }

  .visual-option input[type="radio"] {
    position: absolute;
    opacity: 0;
  }

  .visual-preview {
    border: 3px solid #ddd;
    border-radius: 8px;
    padding: 2px 2px 8px 2px;
    transition: all 0.3s ease;
    text-align: center;
  }

  .visual-preview img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
  }

  .visual-preview.windows img {
    width: 100%;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
  }

  .visual-label {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
  }

  .visual-option input:checked + .visual-preview {
    border-color: #ff8800;
    background-color: #f0f8ff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
  }

  .visual-preview:hover {
    border-color: #999;
    transform: translateY(-2px);
  }

  .select-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .select-group select {
    max-width: 140px;
  }

/* Chatbot Wrapper - contains chatbot + prompt bubble */
.chatbot-wrapper {
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Chatbot Styles */
.chatbot-container {
    flex: 1;
    min-width: 300px;
    max-width: 564px;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 100%;
    max-height: 800px;
}

.chatbot-header {
    background-color: #272727;
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
}

.chatbot-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.chatbot-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 15px;
    background-color: white;
    min-height: 400px;
    max-height: 500px;
}

.user-message,
.bot-message,
.error-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 95%;
}

.user-message {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
    width: 80%;
    margin: 0 0 10px 19%;
}

.bot-message {
    background-color: #f5f5f5;
    border-left: 3px solid #4caf50;
    width: 80%;
    margin: 0 19% 10px 0;
}

.error-message {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
}

.bot-message pre {
    background-color: #272727;
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.bot-message code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.typing-indicator {
    font-style: italic;
    opacity: 0.7;
}

.chatbot-input-area {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    width: 94%;
}

.chatbot-input-area textarea {
    width: 96%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.prompt-bubble {
    flex-shrink: 0;
    background-color: #ffc107;
    color: #1a1a1a;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 18px;
    line-height: 1.5em;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: fadeInBounce 0.5s ease-out;
    z-index: 1000;
    width: 160px;
    max-width: 160px;
    align-self: flex-end;
    position: relative;
    margin: 0 0 75px 0;
}

.prompt-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffc107;
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    60% {
        opacity: 1;
        transform: translateX(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.chatbot-input-area button {
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    background-color: #ff8800;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.chatbot-input-area button:hover {
    background-color: #2c5f2d;
}

.apply-config-btn {
    margin: 15px;
    padding: 12px;
    background-color: #ff8800;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 400px;
}

.apply-config-btn:hover {
    background-color: #e67700;
}

/* Preset buttons in chat */
.preset-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 15px 15px 15px;
    margin: 0;
    align-items: flex-start;
    background: transparent;
    border: none;
}

.preset-btn {
    width: 200px;
    padding: 10px 16px;
    background-color: #2c5f2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preset-btn:hover {
    background-color: #2c5f2d;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.preset-btn:active {
    background-color: #2c5f2d;
    transform: translateY(0);
}

.current-configuration,
.sidebar {
  display: none;
}

/* Header for option buttons */
.option-header {
    padding: 8px 15px 4px 15px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Option buttons in chat (wizard-style) */
.option-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 15px 15px 15px;
    margin: 0;
    align-items: flex-start;
    background: transparent;
    border: none;
}

.option-btn {
    width: 200px;
    padding: 10px 16px;
    background-color: #2c5f2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.option-btn:hover {
    background-color: #2c5f2d;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.option-btn:active {
    background-color: #2c5f2d;
    transform: translateY(0);
}

/* Header for suggestion bubbles */
.suggestion-header {
    padding: 8px 15px 4px 15px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin: 0;
}

/* Suggestion bubbles (yellow prompts to guide user) */
.suggestion-bubbles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 15px 15px 15px;
    margin: 0;
    align-items: flex-start;
    background: transparent;
    border: none;
}

.suggestion-btn {
    padding: 10px 16px;
    background-color: #ffc107;
    color: #1a1a1a;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 300px;
}

.suggestion-btn:hover {
    background-color: #ffb300;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.suggestion-btn:active {
    background-color: #ffa000;
    transform: translateY(0);
}

/* iMac Styles */
.imac-screen-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
    padding: 18px;
    box-sizing: border-box;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.imac-screen {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    width: 100%;
    box-sizing: border-box;
}

.imac-camera {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #808080;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(40,40,40,0.8),
        inset 0 1px 2px rgba(0,0,0,0.5);
    z-index: 10;
}

.imac-content {
    display: flex;
    gap: 30px;
    height: 100%;
    border: none;
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
}

/* ========================================
   RESPONSIVE DESIGN - Media Queries
   ======================================== */

/* Moderate screens: 1500px and below */
@media (max-width: 1500px) {
    .imac-content {
        gap: 25px;
        padding: 35px;
    }

    .chatbot-container {
        max-width: 520px;
    }

    .prompt-bubble {
        display: none; /* Hide prompt bubble on smaller screens */
    }
}

/* Target 1280px screens */
@media (max-width: 1350px) {
    .imac-content {
        gap: 20px;
        padding: 30px;
    }

    .imac-screen-wrapper {
        padding: 15px;
    }

    /* Chatbot adjustments */
    .chatbot-container {
        max-width: 480px;
        min-width: 280px;
    }


    .chatbot-header h3 {
        font-size: 16px;
    }

    .chatbot-header p {
        font-size: 12px;
    }

    .chatbot-header {
        padding: 12px;
    }

    .chatbot-messages {
        padding: 12px;
        min-height: 350px;
        max-height: 450px;
    }

    .user-message,
    .bot-message,
    .error-message {
        padding: 8px;
        font-size: 14px;
    }

    .chatbot-input-area {
        padding: 12px;
        width: 95%;
    }

    .chatbot-input-area textarea {
        font-size: 13px;
    }

    .chatbot-input-area button {
        font-size: 14px;
        padding: 8px;
    }

    /* Price estimator adjustments */
    .price-estimator {
        padding: 15px;
    }

    .price-estimator h3 {
        font-size: 16px;
    }

    .price-total {
        font-size: 28px;
    }

    .price-breakdown {
        font-size: 13px;
    }

    /* Installation section */
    .installation {
        padding: 15px;
    }

    .installation h4 {
        font-size: 16px;
    }

    /* Buttons */
    .preset-btn,
    .option-btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    .suggestion-btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    /* Scene container adjustments */
    .scene-container {
        max-width: 650px;
    }

    .price-estimator {
        max-width: 600px !important;
    }

    .installation {
        max-width: 600px;
    }

    .installation-input input {
        width: calc(100% - 20px);
    }
}

/* Even tighter for true 1280px */
@media (max-width: 1280px) {
    .imac-content {
        gap: 18px;
        padding: 25px;
    }

    .chatbot-container {
        max-width: 450px;
    }

    .scene-container {
        max-width: 600px;
    }

    .price-estimator {
        max-width: 570px !important;
    }

    .installation {
        max-width: 570px;
    }

    .apply-config-btn {
        width: 350px;
    }
}