.flip-container {
    perspective: 1000px;
    width: 100%;
    height: 600px;
    position: relative;
    margin: 0 auto;
}

.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.front,
.back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid #ededed;
    /* Border from original */
    overflow: hidden;
}

.front {
    z-index: 2;
    transform: rotateY(0deg);
}

.back {
    transform: rotateY(180deg);
}

.flip-container.flipped .flipper {
    transform: rotateY(180deg);
}

/* Loading animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =================== BASE DOOR ELEMENTS =================== */
.door {
    position:absolute;
    bottom: 40px;
    left: 50.3%;
    transform: translateX(-50%);
    height: 420px;
    width: auto;
    z-index: 4;
    object-fit: cover;
}

.in-door {
    position: absolute;
    bottom: -25px;
    /* sejajar dengan lantai */
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    height: 690px !important;
    /* perbesar agar menutup dinding penuh */
    width: auto;
    object-fit: contain;
}

.door-handle {
    position: absolute;
    bottom: 50px;
    left: 50.3%;
    transform: translateX(-50%);
    height: 420px;
    width: auto;
    z-index: 4;
    object-fit: contain;
    transition: left 0.3s ease;
}

.in-door-handle {
    bottom: 50px;
    left: 57.5%;
    transform: translateX(-50%);
    height: 420px;
    width: auto;
    z-index: 4;
    object-fit: contain;
}

.list-wall{
    position: absolute; 
    left: -10px; 
    bottom: 0px; 
    z-index:1; 
    width: auto;
    height:590px;
    object-fit:fill;

}

@media (min-width: 360px) and (orientation: portrait) {
    .door {
        bottom: 40px;
        height: 400px;
    }

    .in-door {
        bottom: -15px;
        /* sejajar dengan lantai */
        left: 50%;
        transform: translateX(-50%);
        z-index: 4;
        height: 550px !important;
        /* perbesar agar menutup dinding penuh */
        width: auto;
        object-fit: contain;
    }

    .door-handle {
        bottom: 50px !important;
        left: 46.5% !important;
        height: 320px !important;
    }

    .in-door-handle {
        bottom: 20px;
        left: 54.3%;
        transform: translateX(-50%);
        height: 420px;
        width: auto;
        z-index: 4;
        object-fit: contain;
    }

     .list-wall{
        position: absolute; 
        left: -45px; 
        bottom: 0px; 
        z-index:1; 
        width: auto;
        height:490px;
        object-fit:fill;
    }
}

@media (min-width: 412px) and (orientation: portrait) {
    .door {
        bottom: 40px;
        height: 400px;
    }

    .in-door {
        bottom: -15px;
        /* sejajar dengan lantai */
        left: 50%;
        transform: translateX(-50%);
        z-index: 4;
        height: 550px !important;
        /* perbesar agar menutup dinding penuh */
        width: auto;
        object-fit: contain;
    }

    .door-handle {
        bottom: 50px !important;
        left: 46.5% !important;
        height: 320px !important;
    }

    .in-door-handle {
        bottom: 20px;
        left: 54.3%;
        transform: translateX(-50%);
        height: 420px;
        width: auto;
        z-index: 4;
        object-fit: contain;
    }

    .list-wall{
        position: absolute; 
        left: -28px; 
        bottom: 0px; 
        z-index:1; 
        width: auto;
        height:490px;
        object-fit:fill;
    }
}

@media (min-width: 576px) and (orientation: portrait) {
    .door {
        bottom: 40px;
        height: 400px;
    }

    .in-door {
        bottom: -15px;
        /* sejajar dengan lantai */
        left: 50%;
        transform: translateX(-50%);
        z-index: 4;
        height: 550px !important;
        /* perbesar agar menutup dinding penuh */
        width: auto;
        object-fit: contain;
    }

    .door-handle {
        bottom: 50px !important;
        left: 46.5% !important;
        height: 320px !important;
    }

    .in-door-handle {
        bottom: 20px;
        left: 54.3%;
        transform: translateX(-50%);
        height: 420px;
        width: auto;
        z-index: 4;
        object-fit: contain;
    }
}

@media (min-width: 800px) and (orientation: portrait) {
    .door {
        bottom: 40px;
        height: 400px;
    }

    .in-door {
        bottom: -18px;
        /* sejajar dengan lantai */
        left: 50%;
        transform: translateX(-50%);
        z-index: 4;
        height: 650px !important;
        /* perbesar agar menutup dinding penuh */
        width: auto;
        object-fit: contain;
    }

    .door-handle {
        bottom: 50px !important;
        left: 46.5% !important;
        height: 320px !important;
    }

    .in-door-handle {
        bottom: 30px;
        left: 58%;
        transform: translateX(-50%);
        height: 420px;
        width: auto;
        z-index: 4;
        object-fit: contain;
    }

    .list-wall{
        position: absolute; 
        left: -45px; 
        bottom: 15px; 
        z-index:1; 
        width: auto;
        height:490px;
        object-fit:fill;
    }
}

@media (max-width: 767.98px) and (orientation: landscape) {
    .door {
        bottom: 180px;
    }

    .door-handle {
        bottom: 220px !important;
        left: 46.5% !important;
        height: 300px !important;
    }

    .in-door-handle {
        bottom: 200px;
        left: 58%;
        transform: translateX(-50%);
        height: 420px;
        width: auto;
        z-index: 4;
        object-fit: contain;
    }
}

/* Color picker styles */
.color-option {
    display: inline-block;
    width: 60px;
    height: 80px;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.color-option:hover {
    transform: scale(1.05);
    border-color: #333;
}

.color-option.active {
    border-color: #333;
    box-shadow: 0 0 0 3px #ededed;
}

.color-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
}

.color-name {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    text-align: center;
    padding: 0 2px;
    line-height: 1.2;
}


/* Frame type styles */
.frame-option {
    display: inline-block;
    width: 120px;
    height: 120px;
    margin: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background-color: #fff;
}

.frame-option:hover {
    transform: scale(1.05);
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.frame-option.active {
    border-color: #333;
    box-shadow: 0 0 0 3px #ededed;
}

.frame-image {
    width: 100%;
    height: 90px;
    object-fit: contain;
    display: block;
    padding: 5px;
}

.frame-name {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* Simple door type styles - minimal design like screenshot */
.door-type-container-simple {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.door-type-option-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    text-align: center;
}

.door-type-option-simple:hover {
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.door-type-option-simple.active {
    border-color: #333;
    background-color: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.door-type-image-simple {
    width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

.door-type-name-simple {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    line-height: 1.2;
}

/* Special case for A01 */
.door-type-option-simple.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.door-type-option-simple.disabled:hover {
    border-color: #ddd;
    background-color: #fff;
    transform: none;
    box-shadow: none;
}

/* Handle Color Option */
.handle-color-option {
    transition: all 0.3s ease;
    background-color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.handle-color-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #333;
}

.handle-color-option.active {
    border-color: #333;
    background-color: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.handle-color-option.active .bg-success {
    display: block !important;
}

/* Handle Type Option — SAMA PERSIS DENGAN DOOR TYPE */
.handle-type-option {
    transition: all 0.3s ease;
    background-color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.handle-type-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #333;
}

.handle-type-option.active {
    border-color: #333;
    background-color: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.handle-type-option.active .bg-success {
    display: block !important;
}

.handle-letter {
    font-size: 16px;
    margin-bottom: 4px;
    color: #555;
}

.handle-name {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}

.handle-color-name {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 575.98px) {
    .door-type-container-simple {
        grid-template-columns: 1fr;
    }

    .door-type-image-simple {
        height: 80px;
    }
}

/* Inside View Mode Styles */
.inside-view-mode {
    position: relative;
    overflow: hidden;
}

.inside-view-mode .nav-link.disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.inside-view-mode .color-option.disabled,
.inside-view-mode .frame-option.disabled,
.inside-view-mode .door-type-option-simple.disabled,
.inside-view-mode .handle-type-option.disabled,
.inside-view-mode .handle-color-option.disabled {
    opacity: 0.3 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.inside-view-mode .color-option.disabled:hover,
.inside-view-mode .frame-option.disabled:hover,
.inside-view-mode .door-type-option-simple.disabled:hover,
.inside-view-mode .handle-type-option.disabled:hover,
.inside-view-mode .handle-color-option.disabled:hover {
    transform: none !important;
    border-color: #ddd !important;
    box-shadow: none !important;
}

/* Ensure configuration panel has relative positioning for overlay */
.bg-white.w-100.p-4.shadow-sm.rounded {
    position: relative;
}

/* Wall Selection Styles */
.select-wall {
    transition: all 0.3s ease;
    min-width: 80px;
}

.select-wall:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.select-wall.active {
    background-color: #333 !important;
    border-color: #333 !important;
    color: white !important;
}

.select-wall.disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Wall Card Styles */
.card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    height: 120px;
    object-fit: cover;
}

.card-body {
    padding: 0.75rem;
}

/* EQUAL HEIGHT COLUMNS & SCROLLABLE RIGHT COLUMN - FIXED */
.main-content-row {
    display: flex;
    align-items: stretch;
}

.main-content-row>.col-md-6 {
    display: flex;
    flex-direction: column;
}

.preview-column {
    height: 600px;
}

.config-column {
    height: 600px;
}

.config-panel {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.tabs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    max-height: calc(600px - 80px);
    /* Total height - action buttons - padding */
}

/* Custom scrollbar styling */
.tab-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.tab-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tab-content-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.tab-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure tab panes don't exceed parent height */
.tab-pane {
    min-height: 100%;
}

/* Adjust for mobile devices */
@media (max-width: 768px) {
    .tab-content-wrapper {
        padding-right: 5px;
        max-height: calc(500px - 80px);
    }

    .tab-content-wrapper::-webkit-scrollbar {
        width: 4px;
    }

    .preview-column,
    .config-column {
        height: 500px;
    }

    .config-panel {
        height: 500px;
    }
}

/* Wall Option Styles - Similar to Color Option */
.wall-option {
    display: inline-block;
    width: 100%;
    height: 80px;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wall-option:hover {
    transform: scale(1.05);
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wall-option.active {
    border-color: #333;
    box-shadow: 0 0 0 3px #ededed;
}

.wall-option-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wall-option:hover .wall-option-overlay,
.wall-option.active .wall-option-overlay {
    opacity: 1;
}

.wall-option-name {
    font-size: 11px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Disabled state for inside view mode */
.wall-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.wall-option.disabled:hover {
    border-color: #ddd !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Tile Option Styles - Similar to Color and Wall Option */
.tile-option {
    display: inline-block;
    width: 100%;
    height: 80px;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tile-option:hover {
    transform: scale(1.05);
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tile-option.active {
    border-color: #333;
    box-shadow: 0 0 0 3px #ededed;
}

.tile-option-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 5px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile-option:hover .tile-option-overlay,
.tile-option.active .tile-option-overlay {
    opacity: 1;
}

.tile-option-name {
    font-size: 11px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Disabled state for inside view mode */
.tile-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.tile-option.disabled:hover {
    border-color: #ddd !important;
    box-shadow: none !important;
    transform: none !important;
}