/* Design Your Dream Space - Enhanced UX Styles */

body { 
    font-family: 'Inter', sans-serif; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    min-height: 100vh;
}

/* Enhanced Header Styles */
.hero-title {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(59, 130, 246, 0.1);
}

/* Trust indicators animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trust-indicator {
    animation: fadeInUp 0.6s ease-out;
}

.trust-indicator:nth-child(2) {
    animation-delay: 0.1s;
}

.trust-indicator:nth-child(3) {
    animation-delay: 0.2s;
}

/* Enhanced typography hierarchy */
h1 {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-weight: 600;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Improved container styling */
.hero-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Progress Steps */
.step-indicator {
    transition: all 0.3s ease-in-out;
}

.step-indicator.active .w-8 {
    background-color: #3b82f6;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.step-indicator.active span {
    color: #374151;
    font-weight: 600;
}

.step-indicator.completed .w-8 {
    background-color: #10b981;
    color: white;
}

.step-indicator.completed span {
    color: #10b981;
    font-weight: 500;
}

/* Color Swatches - Enhanced */
.color-swatch {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #e5e7eb;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.05);
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-swatch.selected {
    border-color: #3b82f6;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    position: relative;
}

.color-swatch.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Section States */
.section-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.section-active {
    opacity: 1;
    transform: translateY(0);
}

.section-completed {
    opacity: 1;
}

/* Enhanced Upload Area */
.upload-area {
    transition: all 0.2s ease-in-out;
}

.upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
}

/* Loading spinner - Enhanced */
.loader {
    border: 4px solid #f1f5f9;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

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

/* Pulse animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
    transform: translateY(0);
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px 0 rgba(59, 130, 246, 0.3);
}

/* Card hover effects */
.card {
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Preview area enhancements */
.preview-container {
    background: linear-gradient(45deg, #f8fafc 25%, transparent 25%), 
                linear-gradient(-45deg, #f8fafc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8fafc 75%), 
                linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Furniture Placement Control Buttons */
.control-btn {
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    font-weight: 500;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

/* Canvas area container */
.canvas-area {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 600px;
}

/* Canvas container and interaction styles */
.room-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0; /* Allow flex item to shrink */
    position: relative;
}

#room-canvas {
    cursor: grab;
    transition: cursor 0.2s ease-in-out;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#room-canvas:active {
    cursor: grabbing;
}

#room-canvas.resize-mode {
    cursor: nw-resize;
}

/* Consistent preview container styling for both room and furniture */
#room-preview-container, #furniture-preview-container {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: #f9fafb;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

#room-preview-container img, #furniture-preview-container img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: auto;
    max-height: 128px;
    object-fit: contain;
}

/* Enhanced drag and drop states */
.border-dashed.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Consistent upload area styling */
.border-dashed {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.border-dashed:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

/* Upload prompt styling consistency */
#room-upload-prompt, #furniture-upload-prompt {
    transition: opacity 0.2s ease-in-out;
}

/* File name styling consistency */
#room-file-name, #furniture-file-name {
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    display: block;
    margin-top: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    cursor: help;
    transition: background-color 0.2s ease;
}

#room-file-name:hover, #furniture-file-name:hover {
    background: #e5e7eb;
}

/* Responsive improvements */
@media (max-width: 1024px) {
    .step-indicator span {
        display: none;
    }
    
    .step-indicator .w-8 {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    body {
        background: #f9fafb;
    }
    
    .color-swatch {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .step-indicator {
        flex-direction: column;
        align-items: center;
        space-x: 0;
        space-y: 0.25rem;
    }
    
    .control-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Language Selector */
.language-btn {
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
}

.language-btn.active {
    background: #3b82f6;
    color: white;
    font-weight: 600;
}

.language-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

/* Smooth transitions for all interactive elements */
* {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Focus states for accessibility */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Success states */
.success-state {
    background-color: #ecfdf5;
    border-color: #10b981;
}

.success-state .step-number {
    background-color: #10b981;
}

/* Furniture placement specific styles */
.furniture-section {
    border-left: 4px solid transparent;
    transition: border-left-color 0.3s ease-in-out;
}

.furniture-section.active {
    border-left-color: #3b82f6;
}

.position-section {
    border-left: 4px solid transparent;
    transition: border-left-color 0.3s ease-in-out;
}

.position-section.active {
    border-left-color: #10b981;
}

/* Enhanced canvas placeholder */
#canvas-placeholder {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#canvas-placeholder:hover {
    border-color: #94a3b8;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Furniture positioning feedback */
.furniture-positioning {
    position: relative;
}

.furniture-positioning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.furniture-positioning.active::before {
    opacity: 1;
}

/* Clickable image previews */
#room-preview, #furniture-preview {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#room-preview:hover, #furniture-preview:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Room drag functionality */
#room-preview {
    cursor: grab;
    user-select: none;
    position: relative;
}

#room-preview:active {
    cursor: grabbing;
}

#room-preview[draggable="true"]:hover {
    cursor: grab;
}



/* Room drag visual feedback */
.room-drag-source {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.room-drag-over {
    border-color: #10b981 !important;
    background-color: #ecfdf5 !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Canvas drag functionality */
#room-canvas {
    cursor: grab;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#room-canvas:active {
    cursor: grabbing;
}

#room-canvas[draggable="true"]:hover {
    cursor: grab;
}

/* Canvas drag visual feedback */
.canvas-drag-source {
    border-color: #8b5cf6 !important;
    background-color: #f3e8ff !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}



/* Add a subtle overlay to indicate clickability */
#room-preview-container::after, #furniture-preview-container::after {
    content: attr(data-click-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

#room-preview-container:hover::after, #furniture-preview-container:hover::after {
    opacity: 1;
}

/* History Bar Styles */
#history-bar {
    min-height: 80px;
    flex-shrink: 0; /* Prevent the history bar from shrinking */
}

#history-thumbnails {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#history-thumbnails::-webkit-scrollbar {
    height: 4px;
}

#history-thumbnails::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 2px;
}

#history-thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

#history-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.history-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

.history-thumbnail:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.history-thumbnail.active {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.history-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}



.history-thumbnail .thumbnail-number {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.6rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}
