/* ========================================= */
/* STUDIO APP STYLES (V12 - Dynamic Canvas)  */
/* ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body, html { height: 100%; width: 100%; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background: #e5e7eb; overflow: hidden; }

.studio-layout { display: flex; height: 100vh; width: 100vw; }

/* --- Left Sidebar --- */
.sidebar { width: 360px; background: #ffffff; border-right: 1px solid #d1d5db; display: flex; flex-direction: column; padding: 25px 20px; box-shadow: 2px 0 15px rgba(0,0,0,0.03); z-index: 100; overflow-y: auto; }
.brand-header h2 { font-size: 1.5rem; margin-bottom: 20px; color: #111; font-weight: 800; border-bottom: 2px solid #111; padding-bottom: 15px;}

.wizard-step { display: none; flex-direction: column; height: 100%; animation: slideIn 0.3s ease; }
.wizard-step.active { display: flex; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.step-indicator { font-size: 0.8rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; }
.step-title { font-size: 1.4rem; font-weight: 800; color: #111; margin-bottom: 20px; }

/* Form Controls & Layout */
.control-group { margin-bottom: 20px; }
.control-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: #333; }
.control-group select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.2s; }
.control-group select:focus { border-color: #111; }
.divider { height: 1px; background: #e5e7eb; margin: 15px 0; width: 100%; }

/* Tools & Buttons */
.btn-tool { width: 100%; padding: 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; color: #374151; margin-bottom: 10px; transition: all 0.2s; font-size: 0.95rem; }
.btn-tool:hover { background: #e5e7eb; border-color: #d1d5db; }

/* Pixabay Search & Grid */
.search-box { display: flex; gap: 5px; margin-bottom: 10px; }
.search-box input { flex: 1; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; outline: none; }
.search-box button { padding: 10px 15px; background: #111; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.image-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; }
.image-grid img:hover { border-color: #3b82f6; }
.loading-text { font-size: 0.8rem; color: #888; text-align: center; width: 100%; grid-column: span 2; }
.pagination-controls { display: none; justify-content: space-between; align-items: center; background: #f8f8f9; padding: 5px; border-radius: 6px; border: 1px solid #eee;}
.btn-page { padding: 5px 12px; font-size: 0.8rem; background: #fff; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-page:hover { background: #e5e7eb; }
.page-info { font-size: 0.75rem; color: #888; font-weight: bold; }

/* Action Footer & Navigation */
.step-nav { margin-top: auto; display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid #eee; }
.action-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid #eee; }
.btn-primary { width: 100%; background: #111; color: #fff; padding: 14px; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; font-size: 1rem; transition: background 0.3s; flex: 1; text-align: center; }
.btn-primary:hover { background: #333; }
.btn-secondary { width: 100%; background: transparent; color: #111; padding: 12px; border-radius: 8px; font-weight: 600; border: 2px solid #111; cursor: pointer; transition: all 0.3s; flex: 1; text-align: center; }
.btn-secondary:hover { background: #f3f4f6; }

/* --- Center Workspace --- */
.workspace { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; background: #e5e7eb; }
.view-toggles { position: absolute; top: 20px; background: #fff; padding: 5px; border-radius: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); z-index: 50; display: flex; gap: 5px; }
.view-toggles button { padding: 8px 20px; border-radius: 25px; border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; background: transparent; color: #6b7280; transition: all 0.2s; }
.view-toggles button.active { background: #111; color: #fff; }

/* DYNAMIC CANVAS WRAPPER (No fixed width/height so JS can size it) */
.canvas-container-wrapper { position: relative; background: #fff; box-shadow: 0 25px 50px rgba(0,0,0,0.1); transition: all 0.3s ease;}

.mockup-overlay, .blueprint-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.mockup-overlay { z-index: 20; }
.blueprint-overlay { z-index: 15; }

/* Floating Toolbar */
.floating-toolbar { position: absolute; bottom: 30px; background: #ffffff; padding: 10px 20px; border-radius: 50px; box-shadow: 0 15px 35px rgba(0,0,0,0.15); z-index: 100; display: flex; align-items: center; gap: 15px; border: 1px solid #e5e7eb; animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toolbar-divider { width: 1px; height: 24px; background: #d1d5db; }
.float-text-controls { display: flex; align-items: center; gap: 10px; }
.float-text-controls select { padding: 8px 12px; border-radius: 20px; border: 1px solid #d1d5db; font-size: 0.85rem; outline: none; background: #f8f8f9; }
.float-text-controls input[type="color"] { border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0; background: none; }
.float-layer-controls { display: flex; gap: 5px; }
.btn-float { padding: 8px 12px; font-size: 0.85rem; background: #f8f8f9; border: 1px solid #e5e7eb; border-radius: 20px; cursor: pointer; font-weight: 600; color: #374151; transition: all 0.2s; }
.btn-float:hover { background: #e5e7eb; }
.btn-float.danger { color: #ef4444; background: #fee2e2; border-color: #fca5a5; }
.btn-float.danger:hover { background: #fecaca; }

/* Email Modal */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; padding: 40px; border-radius: 16px; width: 90%; max-width: 450px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); text-align: center; }
.modal-box h3 { margin-bottom: 15px; font-size: 1.5rem; color: #111; }
.modal-box p { color: #555; line-height: 1.5; margin-bottom: 25px; font-size: 0.95rem; }
.modal-box input { width: 100%; padding: 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; outline: none; margin-bottom: 25px; }
.modal-box input:focus { border-color: #111; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; }