/**
 * Private Room Scanner - Matching Room History Design
 * @version 4.0.0
 */

/* Import Room History design variables */
:root {
    --bg-primary: #0a0b0d;
    --bg-secondary: #12151a;
    --bg-card: #1a1d23;
    --bg-hover: #1f2229;
    --accent: #646cff;
    --accent-purple: #a78bfa;
    --accent-secondary: #a78bfa;
    --accent-dim: #4046d3;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.06);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* ==================== ROOMS CONTAINER GRID ==================== */
.rooms-container, #rooms-container {
    margin-top: 40px !important;
    padding: 20px !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

/* ==================== MODERN ROOM CARD ==================== */
.room-group {
    background: linear-gradient(135deg, #1a1d23, #12151a) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.room-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.6);
}

/* Room header with gradient overlay */
.room-header {
    position: relative;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1d23, #12151a);
    flex-shrink: 0;
}

.room-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.room-group:hover .room-header img {
    transform: scale(1.05);
}

/* Placeholder for rooms without images */
.room-placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #1a1d23 0%, #0f1218 40%, #161a24 60%, #1a1d23 100%);
    position: relative;
    overflow: hidden;
}

.room-placeholder-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(100, 108, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
}

.room-placeholder-img i {
    font-size: 48px;
    color: rgba(100, 108, 255, 0.25);
    position: relative;
    z-index: 1;
}

.room-placeholder-img span {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.room-group:hover .room-placeholder-img i {
    color: rgba(100, 108, 255, 0.35);
    transition: color 0.5s ease;
}

.room-group:hover .room-placeholder-img span {
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.5s ease;
}

.room-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to top,
        rgba(26, 29, 35, 0.98) 0%,
        rgba(26, 29, 35, 0.7) 50%,
        transparent 100%);
}

/* Clickable room title */
.room-title-clickable {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s;
}

.room-title-clickable:hover {
    background: rgba(139, 92, 246, 0.1);
}

.room-title-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-title-main h2 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.room-expand-icon {
    color: var(--accent-purple);
    font-size: 18px;
    transition: transform 0.3s;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.6));
}

/* Room info panel */
.room-info-panel {
    background: linear-gradient(135deg, #1a1d23, #12151a);
    padding: 24px;
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
}

.room-info-description {
    color: #d1d5db;
    line-height: 1.8;
    margin-bottom: 24px;
    font-size: 14px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--accent-purple);
}

.room-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.room-info-item {
    padding: 16px;
    background: rgba(100, 108, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(100, 108, 255, 0.15);
}

.room-info-label {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-info-value {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
}

/* Room content tabs */
.room-content-tabs {
    background: linear-gradient(135deg, #1a1d23, #12151a);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
    padding: 8px;
    flex-wrap: wrap;
}

/* Room tabs now use Tailwind styling from shared CSS - no custom overrides needed */

/* Removed custom room-tab media query - using Tailwind defaults */

/* Room content area */
.room-content-area {
    background: #0d1117;
    padding: 0 !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.room-content-area:has(.tab-content[id^="outfits-"].active) {
    min-height: 500px !important;
    max-height: 500px !important;
    overflow: hidden !important;
}

.room-content-area:has(.tab-content[id^="furniture-"].active) {
    min-height: 500px !important;
    max-height: 500px !important;
    overflow: hidden !important;
}

.room-content-area:has(.tab-content[id^="participants-"].active) {
    min-height: auto !important;
    max-height: 600px !important;
    overflow: hidden !important;
}

/* Tab content */
.tab-content {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-content.active {
    display: block;
}

/* Participants tab */
.tab-content[id^="participants-"] {
    padding: 0 !important;
    overflow-y: auto !important;
}

[id^="participants-"] > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 12px !important;
    padding: 30px !important;
    width: 100% !important;
}

.tab-content[id^="participants-"]::-webkit-scrollbar {
    width: 8px;
}

.tab-content[id^="participants-"]::-webkit-scrollbar-track {
    background: #12151a;
    border-radius: 8px;
}

.tab-content[id^="participants-"]::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, var(--accent-purple), #7c3aed);
    border-radius: 8px;
}

.tab-content[id^="participants-"]::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, var(--accent-purple), var(--accent-purple));
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Outfits tab */
.tab-content[id^="outfits-"] {
    padding: 0;
}

[id^="outfit-grid-"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.outfit-card {
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.outfit-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 36px rgba(100, 108, 255, 0.4);
    border-color: rgba(100, 108, 255, 0.6);
}

/* Furniture tab */
.tab-content[id^="furniture-"] {
    padding: 24px;
}

/* Custom scrollbars */
.tab-content::-webkit-scrollbar {
    width: 8px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, var(--accent-purple), #7c3aed);
    border-radius: 8px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, var(--accent-purple), var(--accent-purple));
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.tab-content::-webkit-scrollbar-track {
    background: #12151a;
    border-radius: 8px;
}

/* Outfit Lightbox */
#outfitLightbox {
    z-index: 99999 !important;
}

#outfitLightbox.flex {
    display: flex !important;
}

/* ==================== MODALS (MATCHING ROOM HISTORY) ==================== */
/* Outfits Modal */
#outfitsModal,
#furnitureModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    padding: 2rem;
}

#outfitsModal:not(.hidden),
#furnitureModal:not(.hidden) {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

#outfitsModal .card,
#furnitureModal .card {
    width: 100%;
    max-width: 1400px;
    display: block;
    background: linear-gradient(135deg, #1a1d23, #12151a);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#outfitsModal .card-header,
#furnitureModal .card-header {
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.15), rgba(167, 139, 250, 0.1));
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#outfitsModal .card-header h2,
#furnitureModal .card-header h2 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

#outfitsModal .card-header h2 i,
#furnitureModal .card-header h2 i {
    color: var(--accent-purple);
    font-size: 24px;
}

#outfitsModal .card-header button,
#furnitureModal .card-header button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 32px;
    line-height: 1;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#outfitsModal .card-header button:hover,
#furnitureModal .card-header button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-purple);
}

#outfitsModalContent,
#furnitureModalContent {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
}

#outfitsModalContent > div,
#furnitureModalContent > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
}

#outfitsModalContent::-webkit-scrollbar,
#furnitureModalContent::-webkit-scrollbar {
    width: 8px;
}

#outfitsModalContent::-webkit-scrollbar-track,
#furnitureModalContent::-webkit-scrollbar-track {
    background: #12151a;
    border-radius: 8px;
}

#outfitsModalContent::-webkit-scrollbar-thumb,
#furnitureModalContent::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, var(--accent-purple), #7c3aed);
    border-radius: 8px;
}

#outfitsModalContent::-webkit-scrollbar-thumb:hover,
#furnitureModalContent::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, var(--accent-purple), var(--accent-purple));
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Modal loading state */
#outfitsModalLoading,
#furnitureModalLoading {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

#outfitsModalLoading i,
#furnitureModalLoading i {
    font-size: 48px;
    color: var(--accent-purple);
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

#outfitsModalLoading p,
#furnitureModalLoading p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Outfit cards in modal */
#outfitsModalContent .outfit-card {
    transition: transform 0.2s ease;
}

#outfitsModalContent .outfit-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Furniture grid in modal */
#furnitureModalContent .room-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Furniture Grid */
.furniture-grid {
    padding: 20px;
}

.furniture-view-btn {
    background: linear-gradient(135deg, #646cff, #4f46e5);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
}

.furniture-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(100, 108, 255, 0.4);
}

.furniture-view-btn i {
    font-size: 20px;
}

/* ==================== SCAN PROGRESS (Keep existing styles) ==================== */
#scanProgressContainer {
    background: linear-gradient(145deg, #1a1d23, #12151a);
    border: 1px solid rgba(100, 108, 255, 0.4);
    border-radius: 16px;
    padding: 0;
    margin: 20px auto 80px;
    max-width: 900px;
    box-shadow: 
        0 0 40px rgba(100, 108, 255, 0.25),
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Scan Header */
.scan-header {
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.15), rgba(100, 108, 255, 0.08));
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(100, 108, 255, 0.3);
}

.scan-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.scan-title i {
    color: #646cff;
    font-size: 20px;
    animation: radar-pulse 2s ease-in-out infinite;
}

@keyframes radar-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.scan-status {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.scan-status i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* User Scan Info */
.user-scan-info {
    padding: 24px;
    border-bottom: 1px solid rgba(100, 108, 255, 0.15);
}

.user-scan-info:last-of-type {
    border-bottom: none;
}

.user-id {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #646cff;
}

.user-id i {
    font-size: 18px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-text, .rooms-found {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.progress-text i, .rooms-found i {
    color: #a78bfa;
}

.progress-text strong, .rooms-found strong {
    color: #fff;
    font-weight: 700;
}

/* Progress Bar Container */
.progress-bar-container {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    height: 15px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(100, 108, 255, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #646cff, #a78bfa, #646cff);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(100, 108, 255, 0.5);
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.progress-percentage {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(100, 108, 255, 0.5);
    position: relative;
    z-index: 1;
    letter-spacing: 2px;
}

.progress-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: scan-line 2s linear infinite;
}

@keyframes scan-line {
    0% { left: 0; }
    100% { left: 100%; }
}

/* Scan Footer */
.scan-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(100, 108, 255, 0.2);
}

.scan-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.scan-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.scan-stat i {
    color: #a78bfa;
}

.scan-stat strong {
    color: #fff;
    font-weight: 700;
}

.cancel-scan-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cancel-scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.cancel-scan-btn i {
    font-size: 14px;
}

/* Visual separator line after scan progress */
#scanProgressContainer::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.progress-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(100, 108, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(100, 108, 255, 0.2);
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-top: 4px;
}

/* User Progress Rows */
.user-progress-row {
    background: rgba(100, 108, 255, 0.05);
    border: 1px solid rgba(100, 108, 255, 0.15);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.user-status {
    font-size: 14px;
    color: #10b981;
}

/* Removed duplicate .progress-bar-container - using the one above with 72px height */

/* Scan controls */
.scan-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.scan-btn {
    background: linear-gradient(135deg, #646cff, #4f46e5);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 108, 255, 0.4);
}

.scan-btn.cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.scan-btn.pause {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Search Container */
.search-container {
    background: linear-gradient(135deg, #1a1d23, #12151a);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin: 0 auto 32px;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.search-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    text-align: center;
}

.search-mode-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.search-mode-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(167, 139, 250, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-mode-btn.active {
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.search-mode-btn:hover {
    background: rgba(167, 139, 250, 0.1);
}

.search-options {
    display: none;
}

.search-options.active {
    display: block;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, #646cff, #4f46e5);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 108, 255, 0.4);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Help dropdown */
.help-section {
    background: rgba(100, 108, 255, 0.05);
    border: 1px solid rgba(100, 108, 255, 0.15);
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.help-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.help-icon {
    color: var(--accent-purple);
    transition: transform 0.3s ease;
}

.help-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    display: none;
}

.help-text {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .room-header {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }
    
    .room-title-main h2 {
        font-size: 18px;
    }
    
    .room-tab {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .search-container {
        padding: 20px;
    }
    
    .search-title {
        font-size: 20px;
    }

    /* Mobile modal styles */
    #outfitsModal,
    #furnitureModal {
        padding: 1rem;
    }

    #outfitsModal .card,
    #furnitureModal .card {
        border-radius: 12px;
    }

    #outfitsModal .card-header,
    #furnitureModal .card-header {
        padding: 16px;
    }

    #outfitsModal .card-header h2,
    #furnitureModal .card-header h2 {
        font-size: 16px;
    }

    #outfitsModal .card-header button,
    #furnitureModal .card-header button {
        font-size: 24px;
        padding: 2px 8px;
    }

    #outfitsModalContent,
    #furnitureModalContent {
        padding: 16px;
    }

    #outfitsModalContent > div,
    #furnitureModalContent > div {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 12px !important;
    }

    #furnitureModalContent .room-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    #outfitsModal,
    #furnitureModal {
        padding: 0.5rem;
    }

    #outfitsModal .card-header,
    #furnitureModal .card-header {
        padding: 12px;
    }

    #outfitsModalContent,
    #furnitureModalContent {
        padding: 12px;
    }

    #outfitsModalContent > div,
    #furnitureModalContent > div {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    #furnitureModalContent .room-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Full-width 3D View button between tabs and content */
.room-3d-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #646cff, #8b5cf6);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.room-3d-btn-full i {
    font-size: 14px;
    opacity: 0.85;
}

.room-3d-btn-full:hover {
    background: linear-gradient(135deg, #5a62e6, #7c4fdb);
    box-shadow: 0 4px 16px rgba(100, 108, 255, 0.35);
}

.room-3d-btn-full:active {
    transform: scale(0.99);
}

/* ============================================================================
   OUTFIT PRODUCTS — Unified Design (matching avatar-outfits)
   ============================================================================ */

/* Modal title */
#modalProductContent > h2,
#modalProductDetails > h2 {
    color: #fff;
    font-size: 22px;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
#modalProductContent > h2 i,
#modalProductDetails > h2 i {
    color: #646cff;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Product Card (scoped to .products-grid to avoid leaking into furniture cards) */
.products-grid .product-item {
    background: linear-gradient(145deg, rgba(26, 29, 35, 0.6), rgba(18, 21, 26, 0.6));
    border: 1px solid rgba(100, 108, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.products-grid .product-item:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 108, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Product Image */
.products-grid .product-item .product-image,
.products-grid .product-item img.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

/* Product Name */
.products-grid .product-item .product-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 12px 0 12px;
}

/* Product Creator */
.products-grid .product-item .product-creator {
    color: #9ca3af;
    font-size: 11px;
    margin-bottom: 8px;
    padding: 0 12px;
}

/* Product Price */
.products-grid .product-item .product-price {
    font-size: 13px;
    font-weight: 700;
    color: #10b981;
    padding: 0 12px;
    margin-bottom: 8px;
}

/* Button Row (Classic / Next) */
.products-grid .product-item .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    padding: 0 12px;
}

/* Button Row Single (Try On) */
.products-grid .product-item .button-row-single {
    padding: 0 12px 12px 12px;
}

/* Product Link Buttons (Classic / Next) */
.products-grid .product-item .product-link {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    padding: 8px 4px;
    background: rgba(100, 108, 255, 0.15);
    border: 1px solid rgba(100, 108, 255, 0.3);
    border-radius: 6px;
    color: #646cff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.products-grid .product-item .product-link:hover {
    background: rgba(100, 108, 255, 0.25);
    border-color: rgba(100, 108, 255, 0.5);
}

/* Try On Button */
.products-grid .product-item .try-on-btn {
    display: block;
    padding: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    border: none;
}
.products-grid .product-item .try-on-btn:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Hidden Product Buttons */
.products-grid .product-item .hidden-product-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.products-grid .product-item .hidden-product-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Product Summary / Total */
.product-total {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.1), rgba(100, 108, 255, 0.05));
    border: 1px solid rgba(100, 108, 255, 0.3);
    border-radius: 12px;
    text-align: center;
}
.product-total-label {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.product-total-amount {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
}

/* Gated Products (non-premium locked cards) */
.vu-hidden-gated {
    position: relative;
    overflow: hidden;
}
.vu-gated-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.06), transparent);
    animation: vuGatedShimmer 3s ease-in-out infinite;
    z-index: 5;
    pointer-events: none;
}
.vu-gated-upgrade-btn {
    display: block;
    margin: 8px 12px 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 8px;
    color: #fbbf24;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
}
.vu-gated-upgrade-btn:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.25));
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}
@keyframes vuGatedFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes vuGatedShimmer {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

/* Responsive — Outfit Products */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .products-grid .product-item .product-image,
    .products-grid .product-item img.product-image {
        height: 160px;
    }
}
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .products-grid .product-item .product-image,
    .products-grid .product-item img.product-image {
        height: 130px;
    }
    .products-grid .product-item .product-name {
        font-size: 12px;
        padding: 8px 8px 0 8px;
    }
    .products-grid .product-item .product-creator {
        font-size: 10px;
        padding: 0 8px;
    }
    .products-grid .product-item .button-row {
        padding: 0 8px;
        gap: 4px;
    }
    .products-grid .product-item .button-row-single {
        padding: 0 8px 8px 8px;
    }
    .products-grid .product-item .product-price {
        padding: 0 8px;
        font-size: 12px;
    }
}
