/* ===========================
   GLOBAL STYLES
   =========================== */
:root {
    --baumann-green: #00A878;
    --baumann-dark-green: #008C65;
    --baumann-light-green: #E8F5F1;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --bg-light: #F8F8F8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    color: var(--text-dark);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   HEADER
   =========================== */
#header {
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 100;
    border-bottom: 3px solid var(--baumann-green);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

#logo-container {
    flex: 0 0 auto;
}

#logo-container img {
    height: 50px;
    width: auto;
}

#header-title {
    flex: 1;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: 0.5px;
}

.header-spacer {
    flex: 0 0 auto;
    width: 150px; /* Same width as logo to keep title centered */
}

/* ===========================
   MAIN LAYOUT
   =========================== */
#main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* When header is hidden, main-layout takes full height */
body:not(:has(#header)) #main-layout {
    height: 100vh;
}

/* ===========================
   VIEWER CONTAINER (LEFT)
   =========================== */
#viewer-container {
    flex: 1;
    background-color: #e5e5e5;
    position: relative;
}

#rooom-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===========================
   CONFIG SIDEBAR (RIGHT)
   =========================== */
#config-sidebar {
    width: 520px;
    background: #ffffff;
    box-shadow: -2px 0 8px rgba(0, 168, 120, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
}

.sidebar-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===========================
   SECTIONS NAVIGATION (VERTICAL)
   =========================== */
#sections-nav.vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

/* Vertical Navigation - Non-Collapsible */
#sections-nav.vertical .category-section-vertical {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

#sections-nav.vertical .category-section-vertical:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#sections-nav.vertical .category-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--baumann-green);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--baumann-green);
}

#sections-nav.vertical .category-content-vertical {
    /* Content container for non-collapsible vertical layout */
}

/* Vertical Navigation - Collapsible */
#sections-nav.vertical .category-section {
    border-bottom: 1px solid var(--border-color);
}

#sections-nav.vertical .category-section:last-child {
    border-bottom: none;
}

#sections-nav.vertical .section-btn {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    border: none;
    border-left: 4px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#sections-nav.vertical .section-btn .collapse-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: var(--text-light);
}

#sections-nav.vertical .section-btn.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

#sections-nav.vertical .category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #ffffff;
}

#sections-nav.vertical .category-content.expanded {
    max-height: 5000px; /* Large enough for long lists */
    overflow: visible;
    padding: 1rem;
    padding-bottom: 1.5rem; /* Extra padding at bottom to prevent clipping */
}

.section-btn:hover {
    background: var(--baumann-light-green);
    border-left-color: var(--baumann-green);
}

/* ===========================
   COLOR OPTIONS (GRID)
   =========================== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-option:hover {
    background-color: var(--baumann-light-green);
}

.color-option.selected {
    background-color: var(--baumann-light-green);
    border-color: var(--baumann-green);
}

.color-sphere {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-option.selected .color-sphere {
    border-color: var(--baumann-green);
    transform: scale(1.1);
}

.color-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.2;
}

.color-ral {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-light);
    text-align: center;
}

.color-option.selected .color-name {
    color: var(--baumann-green);
    font-weight: 600;
}

.color-option.selected .color-ral {
    color: var(--baumann-dark-green);
}

.color-expand-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.color-expand-btn:hover {
    background: var(--baumann-light-green);
}

.color-expand-btn .expand-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: bold;
    transition: all 0.2s ease;
}

.color-expand-btn:hover .expand-icon {
    background: var(--baumann-light-green);
    border-color: var(--baumann-green);
    color: var(--baumann-green);
}

/* ===========================
   COMPONENT/ACCESSORY OPTIONS (LIST)
   =========================== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.5rem; /* Prevent last item from being clipped */
}

.list-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-option:hover {
    background: var(--baumann-light-green);
    border-color: var(--border-color);
}

.list-option.selected {
    background: var(--baumann-light-green);
    border-color: var(--baumann-green);
}

.option-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #ffffff;
}

.list-option.selected .option-checkbox {
    border-color: var(--baumann-green);
}

.option-checkbox::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--baumann-green);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.list-option.selected .option-checkbox::after {
    opacity: 1;
}


.design-section {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.design-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.design-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--baumann-green);
    margin-bottom: 0.75rem;
}

.option-info {
    flex: 1;
}

.option-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.option-description {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    #config-sidebar {
        width: 400px;
    }

    .options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #main-layout {
        flex-direction: column;
    }

    #config-sidebar {
        width: 100%;
        max-height: 50vh;
    }

    #viewer-container {
        height: 50vh;
    }

    #header-title {
        font-size: 1.25rem;
    }

    .header-spacer {
        display: none;
    }

    #header {
        padding: 0.75rem 1rem;
    }

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

/* ===========================
   DIMENSION SLIDERS
   =========================== */
.slider-wrapper {
    margin-bottom: 1.25rem;
}

.slider-wrapper:last-child {
    margin-bottom: 0;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.slider-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--baumann-green);
    min-width: 80px;
    text-align: right;
}

/* Range Slider Styling */
.dimension-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--baumann-green) 0%, var(--baumann-green) 50%, var(--border-color) 50%, var(--border-color) 100%);
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dimension-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--baumann-green);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 168, 120, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dimension-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 168, 120, 0.4);
}

.dimension-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 168, 120, 0.5);
}

.dimension-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--baumann-green);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 168, 120, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dimension-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 168, 120, 0.4);
}

.dimension-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
}

/* Focus state */
.dimension-slider:focus {
    outline: none;
}

.dimension-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(0, 168, 120, 0.2), 0 2px 6px rgba(0, 168, 120, 0.3);
}
