/* Room Visualiser Styles - Version 2.5 Canada */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:wght@500;600&display=swap');

/* ==================== OVERLAY & MODAL ==================== */
.rv-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 999999; align-items: center; justify-content: center; }
.rv-overlay.active { display: flex; }
.rv-modal { background: #fff; width: 95vw; max-width: 1200px; max-height: 90vh; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; font-family: 'DM Sans', sans-serif; }
.rv-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid #eee; }
.rv-header h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 600; margin: 0; color: #1a1a1a; }

/* CLOSE BUTTON - MUCH BIGGER */
.rv-close-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.rv-close-btn:hover { background: #e0e0e0; }
.rv-close-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Steps */
.rv-steps { display: flex; gap: 8px; padding: 0 24px 16px; border-bottom: 1px solid #eee; background: #fafafa; flex-wrap: wrap; }
.rv-step { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; color: #999; transition: all 0.3s; }
.rv-step.active { background: #1a1a1a; color: #fff; }
.rv-step.completed { color: #c0392b; }
.rv-step-num { width: 24px; height: 24px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; }
.rv-step.active .rv-step-num { background: #fff; color: #1a1a1a; }
.rv-step.completed .rv-step-num { background: #c0392b; color: #fff; }

/* Body */
.rv-body { flex: 1; overflow-y: auto; position: relative; }
.rv-state { display: none; height: 100%; }
.rv-state.active { display: flex; }

/* ==================== STATE 1: UPLOAD ==================== */
.rv-upload-state { flex-direction: column; align-items: center; padding: 30px 40px; gap: 30px; }

/* Saved Room Option */
.rv-saved-room {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #fdf2f0 0%, #fce8e6 100%);
    border: 2px solid #c0392b;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.15);
}
.rv-saved-room-preview {
    width: 160px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e8e4df;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.rv-saved-room-preview canvas { width: 100%; height: 100%; object-fit: cover; }
.rv-saved-room-info { flex: 1; }
.rv-saved-room-info h4 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 6px; color: #1a1a1a; }
.rv-saved-room-info p { font-size: 0.9rem; color: #555; margin-bottom: 16px; }
.rv-saved-room-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.rv-saved-room-buttons .rv-btn-primary,
.rv-saved-room-buttons .rv-btn-secondary { width: auto; margin: 0; padding: 12px 20px; font-size: 0.95rem; }
.rv-saved-room-buttons .rv-btn-primary { background: #c0392b; }
.rv-saved-room-buttons .rv-btn-primary:hover { background: #a93226; }

.rv-upload-area { width: 100%; max-width: 500px; padding: 50px 30px; border: 2px dashed #ccc; border-radius: 16px; text-align: center; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rv-upload-area:hover, .rv-upload-area.dragover { border-color: #1a1a1a; background: #fafafa; }
.rv-upload-icon svg { width: 48px; height: 48px; color: #999; margin-bottom: 16px; }
.rv-upload-area h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 8px; }
.rv-upload-area p { color: #666; margin-bottom: 16px; }
.rv-upload-btn { background: #1a1a1a; color: #fff; border: none; padding: 14px 32px; border-radius: 8px; font-family: inherit; font-size: 1rem; cursor: pointer; transition: background 0.3s; }
.rv-upload-btn:hover { background: #333; }
.rv-upload-hint { font-size: 0.8rem; color: #999; margin-top: 12px; }

/* How-To Cards */
.rv-howto { width: 100%; max-width: 700px; }
.rv-howto-title { font-family: 'Playfair Display', serif; font-size: 1rem; text-align: center; margin-bottom: 16px; color: #666; }
.rv-howto-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.rv-howto-card { flex: 1; min-width: 150px; max-width: 200px; padding: 20px 16px; background: #fafafa; border-radius: 12px; text-align: center; }
.rv-howto-icon { font-size: 2rem; margin-bottom: 8px; }
.rv-howto-text { font-size: 0.85rem; color: #555; line-height: 1.4; }

/* ==================== STATE 2: SELECT WALL ==================== */
.rv-select-state { flex-direction: row; }
.rv-canvas-container { flex: 1; display: flex; align-items: center; justify-content: center; background: #f5f3f0; padding: 20px; position: relative; min-height: 400px; }
.rv-canvas-container canvas { max-width: 100%; max-height: 60vh; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); cursor: crosshair; }
.rv-brush-cursor { position: absolute; pointer-events: none; border: 2px solid #1a1a1a; border-radius: 50%; display: none; z-index: 50; }
.rv-brush-cursor.active { display: block; }
.rv-brush-cursor.tool-add { border-color: #c0392b; background: rgba(192,57,43,0.15); }
.rv-brush-cursor.tool-remove { border-color: #c45c3e; background: rgba(196,92,62,0.15); }

.rv-controls { width: 320px; padding: 24px; border-left: 1px solid #eee; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }

/* Step Sections */
.rv-step-section { padding: 16px; background: #fafafa; border-radius: 12px; transition: opacity 0.3s; }
.rv-step-section.disabled { opacity: 0.4; pointer-events: none; }
.rv-step-section.completed .rv-section-badge { background: #c0392b; }
.rv-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rv-section-badge { width: 24px; height: 24px; background: #1a1a1a; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.rv-section-title { font-weight: 500; font-size: 0.9rem; }

/* Color Sample */
.rv-colour-sample { display: flex; align-items: center; gap: 12px; }
.rv-colour-swatch { width: 48px; height: 48px; border-radius: 8px; background: #ccc; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.rv-colour-info { display: flex; flex-direction: column; gap: 2px; }
.rv-colour-label { font-weight: 500; font-size: 0.85rem; }
.rv-colour-rgb { font-size: 0.75rem; color: #666; font-family: monospace; }

/* Sliders */
.rv-slider-group { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.rv-slider-group label { color: #666; min-width: 70px; }
.rv-slider { flex: 1; height: 6px; -webkit-appearance: none; background: #e0e0e0; border-radius: 3px; outline: none; }
.rv-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: #1a1a1a; border-radius: 50%; cursor: pointer; }

/* Tools */
.rv-tools { display: flex; gap: 12px; margin-bottom: 12px; }
.rv-tool-btn { 
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #ddd; 
    background: #fff; 
    border-radius: 8px; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.rv-tool-btn:hover { border-color: #1a1a1a; }
.rv-tool-btn.active { border-color: #c0392b; background: #fdf2f0; }
.rv-tool-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.rv-tool-label { font-size: 0.7rem; color: #888; text-align: center; line-height: 1.2; }
.rv-tool-btn:hover .rv-tool-label { color: #1a1a1a; }
.rv-tool-btn.active .rv-tool-label { color: #c0392b; }

/* Actions */
.rv-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid #eee; }
.rv-btn-primary { flex: 1; background: #1a1a1a; color: #fff; border: none; padding: 14px 20px; border-radius: 8px; font-family: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: background 0.3s; }
.rv-btn-primary:hover { background: #333; }
.rv-btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.rv-btn-secondary { background: #fff; color: #1a1a1a; border: 2px solid #ddd; padding: 14px 20px; border-radius: 8px; font-family: inherit; font-size: 0.95rem; cursor: pointer; transition: all 0.3s; }
.rv-btn-secondary:hover { border-color: #1a1a1a; }

/* ==================== STATE 3: PREVIEW ==================== */
.rv-preview-state { flex-direction: row; }
.rv-preview-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f5f3f0; padding: 20px; position: relative; }
.rv-preview-main canvas { max-width: 100%; max-height: 55vh; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.rv-drag-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 0.85rem; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.rv-drag-hint.visible { opacity: 1; }

.rv-preview-sidebar { width: 340px; padding: 24px; border-left: 1px solid #eee; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.rv-product-card { display: flex; gap: 16px; padding: 16px; background: #fafafa; border-radius: 12px; }
.rv-product-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.rv-product-info h4 { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 4px; }
.rv-product-info p { font-size: 0.8rem; color: #666; }
.rv-type-badge { display: inline-block; background: #e8e4df; color: #666; font-size: 0.65rem; padding: 3px 8px; border-radius: 4px; vertical-align: middle; margin-left: 8px; font-family: 'DM Sans', sans-serif; }

/* Mural Controls */
.rv-mural-controls {
    padding: 16px;
    background: #f5f3f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.rv-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rv-control-row label {
    font-size: 0.85rem;
    color: #666;
    min-width: 50px;
}
.rv-control-row .rv-slider {
    flex: 1;
}
.rv-control-row span {
    font-size: 0.85rem;
    min-width: 45px;
    text-align: right;
}
.rv-icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.rv-icon-btn:hover { border-color: #1a1a1a; }
.rv-icon-btn.active { border-color: #c0392b; background: #fdf2f0; }
.rv-icon-btn svg { width: 18px; height: 18px; }
.rv-btn-small {
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.rv-btn-small:hover { border-color: #1a1a1a; }

/* Wallpaper Controls */
.rv-wallpaper-controls { padding: 16px; background: #f5f3f0; border-radius: 12px; }
.rv-input { width: 80px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 0.9rem; }

.rv-preview-actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.rv-btn-link { background: none; border: none; color: #666; font-family: inherit; font-size: 0.9rem; cursor: pointer; padding: 8px 0; text-align: center; }
.rv-btn-link:hover { color: #1a1a1a; }

/* ==================== STATE 4: CONFIRM ==================== */
.rv-confirm-state { flex-direction: column; align-items: center; padding: 40px; gap: 24px; }
.rv-final-preview { max-width: 100%; }
.rv-final-preview canvas { max-width: 100%; max-height: 45vh; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.rv-final-text { text-align: center; }
.rv-looking-good { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: 8px; }
.rv-final-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.rv-btn-large { padding: 16px 40px; font-size: 1.1rem; }
.rv-final-nav { display: flex; gap: 24px; }

/* ==================== LOADING ==================== */
.rv-loading { position: absolute; inset: 0; background: rgba(255,255,255,0.9); display: none; align-items: center; justify-content: center; z-index: 100; }
.rv-loading.active { display: flex; }
.rv-spinner { width: 40px; height: 40px; border: 3px solid #e0e0e0; border-top-color: #1a1a1a; border-radius: 50%; animation: rv-spin 0.8s linear infinite; }
@keyframes rv-spin { to { transform: rotate(360deg); } }

/* ==================== SHARE MODAL ==================== */
.rv-share-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000000; align-items: center; justify-content: center; }
.rv-share-overlay.active { display: flex; }
.rv-share-modal { background: #fff; padding: 32px; border-radius: 16px; max-width: 450px; width: 90%; position: relative; }
.rv-share-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: none; background: #f0f0f0; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; }
.rv-share-modal h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 20px; }
.rv-share-preview { margin-bottom: 20px; }
.rv-share-preview canvas { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; background: #f5f3f0; }
.rv-form-group { margin-bottom: 16px; }
.rv-form-group label { display: block; font-size: 0.85rem; margin-bottom: 6px; color: #666; }
.rv-form-group input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 1rem; box-sizing: border-box; }
.rv-share-form .rv-btn-primary { width: 100%; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .rv-select-state, .rv-preview-state { flex-direction: column; }
    .rv-controls, .rv-preview-sidebar { width: 100%; border-left: none; border-top: 1px solid #eee; max-height: 40vh; }
    .rv-saved-room { flex-direction: column; text-align: center; }
    .rv-saved-room-buttons { justify-content: center; }
}
@media (max-width: 600px) {
    .rv-modal { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .rv-steps { padding: 8px 16px 12px; gap: 4px; }
    .rv-step span:not(.rv-step-num) { display: none; }
    .rv-upload-state { padding: 20px; }
    .rv-howto-cards { flex-direction: column; align-items: center; }
}
