:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --bg: #f8fafc;
    --sidebar: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 420px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 40px rgba(0,0,0,0.02);
    z-index: 100;
}

.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); }
.brand { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.brand span { color: var(--primary); }
.back-home { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-decoration: none; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; transition: 0.2s; }
.back-home:hover { background: var(--border); color: var(--text); }


/* Accordion Panels */
.editing-panels { flex: 1; overflow-y: auto; padding: 12px; }

.panel-item { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.panel-trigger {
    width: 100%; padding: 16px; background: white; border: none; text-align: left;
    font-weight: 700; color: var(--text); display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; font-size: 0.9rem; transition: background 0.2s;
}
.panel-trigger:hover { background: #fafafa; }
.panel-trigger i { transition: transform 0.3s; font-size: 0.8rem; color: var(--muted); }
.panel-item.open .panel-trigger i { transform: rotate(180deg); }

.panel-content { display: none; padding: 20px; background: #fcfcfd; border-top: 1px solid var(--border); }
.panel-item.open .panel-content { display: block; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"], input[type="tel"], textarea, select {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 0.9rem; transition: border-color 0.2s; background: white;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }

/* Theme bubbles */
.theme-options { display: flex; gap: 10px; }
.theme-option input { display: none; }
.theme-option span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.theme-option input:checked + span { border-color: #000; transform: scale(1.1); }


/* Service List Admin */
.admin-service-item {
    background: white; border: 1px solid var(--border); padding: 12px; border-radius: 8px; margin-bottom: 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.admin-service-controls { display: flex; justify-content: flex-end; gap: 8px; }
.btn-icon { border: none; background: #f1f5f9; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.btn-icon:hover { background: var(--border); color: var(--text); }

/* Sidebar Footer */
.sidebar-footer { padding: 24px; border-top: 1px solid var(--border); background: white; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.3s; border: none;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(37,99,235,0.2); }
.btn.outline { background: transparent; border: 2px solid var(--border); color: var(--muted); }
.btn.full { width: 100%; }
.btn.small { padding: 8px 16px; font-size: 0.8rem; }

/* Preview */
.preview-area { flex: 1; padding: 24px; display: flex; flex-direction: column; background: #e2e8f0; }
.preview-header {
    background: white; padding: 0 20px; height: 50px; border-radius: 16px 16px 0 0;
    display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f0f0;
}
.browser-controls { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.preview-mode-switch { background: #f1f5f9; padding: 4px; border-radius: 8px; display: flex; gap: 4px; }
.preview-mode-switch button {
    border: none; background: transparent; width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; color: var(--muted); transition: 0.2s;
}
.preview-mode-switch button.active { background: white; color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.preview-status { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

#frame-container { flex: 1; background: white; border-radius: 0 0 16px 16px; overflow: hidden; display: flex; justify-content: center; box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
iframe { width: 100%; height: 100%; border: none; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
iframe.mobile { width: 375px; height: 80%; margin-top: 40px; border: 12px solid #1e293b; border-radius: 40px; }

/* Gallery Thumbnails */
.thumb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.thumb-item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: rgba(0,0,0,0.5); border: none; color: white; border-radius: 50%; cursor: pointer; font-size: 10px; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 40px; border-radius: 20px; text-align: center; }
