/* --- ar-editor.css --- */
/* --- AR Content Management Styles --- */
.ar-management-container {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.ar-editor-layout {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 30px;
}

/* 삭제: 마커 프리뷰 컨테이너 스타일 */
/*
.marker-preview-container {
    margin-bottom: 20px;
    flex-basis: 150px;
    flex-shrink: 0;
    text-align: center;
}

.marker-preview-container h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: left;
}

#marker-preview-img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #eee;
    min-height: 100px;
}
*/

.ar-editor-area {
    flex-grow: 1; /* Take remaining space */
    display: flex;
    flex-wrap: wrap; /* Allow controls to wrap */
    gap: 20px;
    min-width: 280px; /* Prevent editor area from getting too small */
    width: 100%; /* Occupy full width after removing preview */
}

.ar-scene-preview {
    width: 280px; /* Fixed width for phone-like preview */
    height: 480px; /* Fixed height */
    border: 1px solid var(--text-muted);
    background-color: #e0e0e0; /* Preview background */
    position: relative; /* For absolute positioning inside */
    overflow: hidden; /* Clip overflowing elements */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0; /* Prevent shrinking */
    margin: 0 auto; /* Center if wrapped */
}

/* 삭제: 씬 내부 마커 스타일 */
/*
.marker-in-scene {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 60%;
    max-height: 60%;
    opacity: 0.7;
}
*/

/* AR Element in Preview Scene */
.ar-image-element-preview {
    position: absolute;
    background-color: rgba(74, 144, 226, 0.7); /* Semi-transparent blue */
    border: 1px dashed var(--primary-dark);
    border-radius: 4px;
    cursor: grab;
    display: flex; /* Center potential content (like text) */
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: var(--white);
    overflow: hidden; /* Clip content if needed */
    white-space: nowrap; /* Prevent text wrap */
    user-select: none; /* Prevent text selection */
    background-size: contain; /* Ensure image fits */
    background-repeat: no-repeat;
    background-position: center;
    /* Centered based on top-left corner. Drag logic adjusts visually. */
}

.ar-image-element-preview img { /* If using <img> inside */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none; /* Prevent image interfering with drag */
}

.ar-image-element-preview.dragging {
    cursor: grabbing;
    opacity: 0.8;
    z-index: 10; /* Ensure it's above other elements */
}

/* AR Element Controls & List */
.ar-element-controls { /* Base for different control types */
    flex-grow: 1;
    min-width: 250px; /* Prevent control area from getting too small */
}

.ar-element-controls h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
}

/* List specific styles */
#ar-image-list, #ar-effect-image-list {
    list-style: none;
    max-height: 400px; /* Limit height */
    overflow-y: auto; /* Add scroll if needed */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px;
    margin: 0; /* Reset default margin */
}

#ar-image-list li, #ar-effect-image-list li {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
    gap: 10px; /* Spacing between elements in the row */
}

#ar-image-list li:last-child, #ar-effect-image-list li:last-child {
    border-bottom: none;
}

.ar-element-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1; /* Allow info to take space */
    min-width: 150px; /* Prevent excessive shrinking */
}

.ar-element-thumb {
    width: 30px;
    height: 30px;
    background-color: #ecf0f1;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0; /* Don't shrink */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid var(--border-color); /* Add subtle border */
}

.ar-element-name {
    flex-grow: 1; /* Allow name to take space */
    word-break: break-all; /* Break long names */
    margin-right: 10px; /* Space before controls */
}

.ar-element-pos-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    white-space: nowrap; /* Prevent wrapping */
    flex-shrink: 0; /* Don't shrink */
}

.ar-element-pos-controls label {
    margin: 0;
    font-weight: normal;
}

.ar-element-pos-controls input[type="number"] {
    width: 50px;
    padding: 2px 4px;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-align: right;
    -moz-appearance: textfield; /* Firefox */
}
/* Hide spinner buttons */
.ar-element-pos-controls input[type=number]::-webkit-inner-spin-button,
.ar-element-pos-controls input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.ar-element-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0; /* Don't shrink */
}

#ar-image-upload, #ar-effect-image-upload {
    display: none; /* Hide file input */
}

/* ===================================
   AR Studio 버튼 - AR Studio 스타일 통일
   (컬렉션 추가/수정 폼 내 AR Studio 버튼)
   =================================== */
#artworks-content #add-edit-artwork-view .form-actions .btn-ar-studio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    margin-right: auto;

    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.9) 0%,
        rgba(79, 70, 229, 0.95) 100%
    );

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 7px;

    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;

    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#artworks-content #add-edit-artwork-view .form-actions .btn-ar-studio:hover {
    background: linear-gradient(
        135deg,
        rgba(124, 127, 245, 1) 0%,
        rgba(99, 102, 241, 1) 100%
    );

    box-shadow:
        0 6px 24px rgba(99, 102, 241, 0.6),
        0 0 30px rgba(99, 102, 241, 0.3);

    transform: translateY(-2px);
}

#artworks-content #add-edit-artwork-view .form-actions .btn-ar-studio:active {
    transform: translateY(0);
}