/*
 * Hangit - Modern Room Visualizer
 * Copyright Velvary Pty Ltd
 */

/* Container styles */
.hangit-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Room selector styles */
#showroom-rooms {
    position: relative;
    height: 70px !important;
    padding: 5px 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    background: #f8f9fa;
    margin-bottom: 10px;
}

#showroom-rooms::-webkit-scrollbar {
    height: 8px;
}

#showroom-rooms::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

#showroom-rooms::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.showroom-roomchoice {
    display: inline-block;
    height: 60px !important;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.showroom-roomchoice:hover {
    transform: translateY(-2px);
}

.showroom-roomchoice img {
    height: 100% !important;
    object-fit: cover;
}

.showroom-roomchoice.active {
    border: 2px solid #007bff;
    transform: translateY(-2px);
}

/* Canvas styles */
#showroom-canvas {
    padding: 10px;
    background: #2a2a2a;
    position: relative;
    width: 94%;
    max-width: 94%;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    aspect-ratio: 16/9;
}

#the-showroom {
    position: relative;
    width: 100%;
    margin: 0;
    background: #000;
    height: 100%;
    overflow: hidden;
}

#the-showroom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#the-showroom-backgroundimg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#thehanging {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    left: 0;
    top: 0;
}

/* Artwork frame styles */
#theframe {
    cursor: move;
    max-width: 70%;
    max-height: 80%;
    margin: 0 !important;
    min-width: 20px;
    min-height: 20px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.2); /* Default border, will be overridden by JavaScript */
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    display: block;
    z-index: 99;
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    object-fit: contain; /* Maintain aspect ratio */
    background-color: transparent;
}

/* Resize handle */
#theframe::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: se-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#theframe:hover::after {
    opacity: 1;
}

/* Instructions */
.hangit-instructions {
    padding: 15px;
    margin: 10px 0;
    color: #495057;
    font-size: 0.9em;
    line-height: 1.5;
    background: #f8f9fa;
    border-radius: 8px;
    flex: 1;
}

/* Backgrounds Header */
.hangit-backgrounds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 15px 15px 15px;
    padding-bottom: 5px;
}

.hangit-backgrounds-header h3 {
    margin: 0;
    font-weight: bold;
    color:#2a2a2a;
}

.hangit-local-background-control {
    display: flex;
    align-items: center;
}

.hangit-local-background-control .button {
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: normal;
    line-height: 1.4;
    min-height: 40px;
    width: 100%;
    max-width: 250px;
}

.hangit-local-background-control .button:hover {
    background-color: #f0f0f0;
    border-color: #999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Controls */
.hangit-controls {
    margin-top: 20px;
}

.hangit-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.hangit-slider-container {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.hangit-slider-container label {
    margin-bottom: 5px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;  
    background: #d3d3d3;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%; 
    background: #4CAF50;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.hangit-border-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.hangit-border-controls select,
.hangit-border-controls input[type="color"] {
    padding: 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.hangit-color-control {
    min-width: 120px;
    flex: 1;
}

.hangit-print-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 100px;
    flex: 0 0 auto;
}

.hangit-print-button button {
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 500;
    min-height: 40px;
    border-radius: 4px;
    transition: all 0.2s;
}

.hangit-print-button button:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Thickbox Overrides */
#TB_window {
    width: 98% !important;
    height: 98% !important;
    max-width: 98% !important;
    max-height: 98% !important;
    margin: 0 !important;
    top: 1% !important;
    left: 1% !important;
    transform: none !important;
}

#TB_ajaxContent {
    width: 100% !important;
    height: calc(100% - 30px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: auto !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hangit-container {
        padding: 10px;
    }

    #showroom-canvas {
        padding: 5px;
    }

    .showroom-roomchoice {
        height: 50px !important;
    }

    #theframe {
        max-width: 85%;
        max-height: 85%;
    }
}

/* Loading states */
.hangit-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
}

/* Animation for room transitions */
.room-transition {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}