/* ✅ Base layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
}

.dashboard-main {
    flex: 1;
    padding: 20px;
    background-color: #ffffff;
    box-sizing: border-box;
}

.sidebar .logo a {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: #333;
    display: block;
    margin-bottom: 20px;
}

.sidebar .btn {
    font-size: 14px;
    padding: 10px;
}

.sidebar .search-bar input {
    font-size: 14px;
    padding: 8px;
}

.sidebar .recent-galleries ul {
    margin-top: 10px;
}

.sidebar .recent-galleries li a {
    display: block;
    padding: 5px 0;
    color: #007bff;
    text-decoration: none;
}

.sidebar-nav ul {
    margin-top: 20px;
}

.sidebar-nav li a {
    color: #333;
    display: block;
    padding: 8px 0;
    text-decoration: none;
}

.sidebar-nav li a:hover {
    text-decoration: underline;
}

/* ✅ Scene and image layout */
.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* important for dropdown alignment */
    margin-top: 40px;
    margin-bottom: 20px; /* NEW: gives dropdown space to expand */
    position: relative;
    z-index: 2;
}

.scene-header h4 {
    margin: 0;
}

/* ✅ Scene Image Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-top: 20px;
}

.col-md-3 {
    flex: 0 0 20%;
    padding: 10px;
    box-sizing: border-box;
}

/* Image thumbnail */
.col-md-3 img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.col-md-3 img:hover {
    transform: scale(1.03);
}

/* ✅ SCENE CONTROLS + IMAGE SELECT STYLES */
.image-wrapper {
    position: relative;
    border: 2px solid transparent;
    cursor: pointer;
}

.image-wrapper.selected {
    border-color: #007bff;
}

.select-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 3px;
    z-index: 10;
    display: none;
}

.image-wrapper.selected .select-overlay {
    display: block;
}

/* Top controls when selecting images */
.top-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}


.top-controls.visible {
    display: block;
}

.top-controls .btn {
    margin-right: 10px;
}

/* Three-dot dropdown for scenes */
.scene-dropdown {
    position: relative;
    display: inline-block;
}

.scene-dropdown .dropdown-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.scene-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    min-width: 180px;

    z-index: 99999; /* ✅ Bump it even higher */
}

.scene-header {
    position: relative; /* ✅ This makes z-index on children work */
    z-index: 1; /* ✅ Ensure it's above .scene-thumbnails and upload form */
}

.scene-dropdown-wrapper {
    position: relative;
    z-index: 1055; /* higher than headers, upload, and images */
}

.scene-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 1055;
}


.scene-dropdown.open .dropdown-menu {
    display: block;
}

.scene-dropdown .dropdown-menu li {
    padding: 8px 12px;
    cursor: pointer;
}

.scene-dropdown .dropdown-menu li:hover {
    background-color: #f0f0f0;
}
/* ✅ Thumbnail Grid - 10 across */
.scene-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.scene-thumbnails .thumbnail {
    position: relative;
    width: calc(10% - 6px);
    aspect-ratio: 1/1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
}
.scene-thumbnails .thumbnail.selected {
    border: 2px solid #007bff;
}

/* ✅ Hover Arrow Icon */
.scene-thumbnails .thumbnail .overlay-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px;
    font-size: 12px;
    border-radius: 50%;
    display: none;
}
.scene-thumbnails .thumbnail:hover .overlay-icon {
    display: block;
}

/* ✅ Global top bar for controls */
#photo-selection-controls {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1000;
    padding: 10px 20px;
    border-bottom: 1px solid #ccc;
    display: none;
}
#photo-selection-controls.active {
    display: flex;
    justify-content: space-between;
    align-items: center;
}



/* Fix thumbnail container for 10 across */
.image-thumb-container {
    width: 10%;
    padding: 4px;
    box-sizing: border-box;
    position: relative;
}

.image-thumb-wrapper {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    aspect-ratio: 1 / 1;
}

.image-thumb-container.selected .image-thumb-wrapper {
    border-color: #007bff;
}
.scene-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.image-thumb-container {
    width: 10%;
    padding: 4px;
    box-sizing: border-box;
    position: relative;
}

.image-thumb-wrapper {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    aspect-ratio: 1 / 1;
}

.image-thumb-container.selected .image-thumb-wrapper {
    border-color: #007bff;
}

.img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.image-thumb-container:hover .img-thumb {
    transform: scale(1.03);
}

.overlay-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px;
    font-size: 12px;
    border-radius: 50%;
    display: none;
    text-decoration: none;
    z-index: 2;
}

.image-thumb-wrapper:hover .overlay-icon {
    display: block;
}

.image-select-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 123, 255, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 1;
}

.image-thumb-container.selected .image-select-overlay {
    opacity: 1;
}

.dropdown-wrapper {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.dropdown-wrapper .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 9999;
}
