/* ==========================================================================
   ELITE CUSTOM EXPORT CSS
   Glassmorphism, Drag-and-Drop Builder, Split View
   ========================================================================== */

/* Layout & Globals */
.cxp-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; display: flex; flex-direction: column; }
.cxp-stage { animation: fadeInUp 0.4s forwards; display: flex; flex-direction: column; flex-grow: 1; }
.cxp-editor-layout { display: flex; gap: 16px; flex-grow: 1; height: calc(100vh - 200px); min-height: 500px; }
.cxp-editor-col { height: 100%; overflow: hidden; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.hidden-mobile { display: flex; }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } .cxp-editor-layout { flex-direction: column; height: auto; } }
.m-0 { margin: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; } .p-8 { padding: 8px; } .p-16 { padding: 16px; } .p-24 { padding: 24px; } .pt-8 { padding-top: 8px; } .pb-16 { padding-bottom: 16px; } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); } .border-top { border-top: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .text-center { text-align: center; } .text-right { text-align: right; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; } .tabular-nums { font-variant-numeric: tabular-nums; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .flex-end { display: flex; justify-content: flex-end; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .flex-grow { flex-grow: 1; min-height: 0; } .flex-shrink-0 { flex-shrink: 0; } .cursor-pointer { cursor: pointer; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-orange { color: #fb923c; } .text-white { color: #ffffff; }
.bg-purple { background: #c084fc; color: #000; } .bg-cyan { background: #06b6d4; color: #000; } .bg-gold { background: #fbbf24; color: #000; } .bg-green { background: #22c55e; color: #000; } .bg-red { background: #ef5350; color: #fff; } .bg-dark { background: rgba(0,0,0,0.3); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); } 70% { box-shadow: 0 0 0 15px rgba(168,85,247,0); } 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }

/* Cards & Buttons */
.cxp-card { background: rgba(255,255,255,0.03); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05); transition: all 0.3s; }

.cxp-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.cxp-btn--primary { background: linear-gradient(135deg, #a855f7, #7e22ce); color: white; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.cxp-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); }
.cxp-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.cxp-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.cxp-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #c084fc; color: #c084fc; }
.cxp-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; }
.cxp-btn-icon:hover { color: white; background: rgba(255,255,255,0.1); transform: scale(1.05); }
.cxp-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.cxp-btn-icon-small:hover { background: rgba(192,132,252,0.2); color: #c084fc; border-color: #c084fc; }
.cxp-btn-text { background: transparent; border: none; font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s; padding: 0; }
.cxp-btn-text:hover { filter: brightness(1.2); }

.cxp-input, .cxp-select { width: 100%; padding: 10px 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; transition: 0.3s; font-family: inherit; font-size: 0.85rem; outline: none; }
.cxp-input:focus, .cxp-select:focus { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(192,132,252,0.2); }
.cxp-form-group { margin-bottom: 16px; }
.cxp-form-group label { display: block; margin-bottom: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.8); font-weight: 600; }

.cxp-search-box { position: relative; width: 100%; }
.cxp-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); font-size: 0.85rem; }
.cxp-search-box input { width: 100%; padding: 8px 12px 8px 32px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; outline: none; font-size: 0.85rem; }
.cxp-search-box input:focus { border-color: #c084fc; }

.cxp-badge { font-size: 0.65rem; padding: 4px 8px; border-radius: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; gap: 4px; }
.border-cyan { border: 1px solid rgba(6,182,212,0.4); }

/* Header */
.cxp-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; flex-shrink: 0; }
.cxp-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.cxp-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.cxp-header__actions { display: flex; gap: 16px; align-items: center; }

/* Grid (Templates) */
.cxp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.cxp-tpl-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; transition: 0.3s; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.cxp-tpl-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.04); border-color: rgba(192,132,252,0.4); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.t-head { display: flex; justify-content: space-between; align-items: flex-start; }
.t-title { font-size: 1.1rem; font-weight: 800; color: #fff; margin: 0; }
.t-desc { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-meta { font-size: 0.75rem; color: rgba(255,255,255,0.5); display: flex; gap: 12px; }
.t-actions { display: flex; gap: 8px; margin-top: auto; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 16px; }

/* Editor Header */
.cxp-title-input { background: transparent; border: none; font-size: 1.5rem; font-weight: 800; color: #fff; font-family: inherit; outline: none; width: 300px; padding: 4px; border-bottom: 1px dashed transparent; transition: 0.2s; }
.cxp-title-input:hover, .cxp-title-input:focus { border-bottom-color: rgba(255,255,255,0.3); }
.cxp-desc-input { background: transparent; border: none; font-family: inherit; outline: none; width: 300px; padding: 4px; display: block; border-bottom: 1px dashed transparent; transition: 0.2s; }
.cxp-desc-input:hover, .cxp-desc-input:focus { border-bottom-color: rgba(255,255,255,0.3); color: #fff; }

/* Drag & Drop Builder Lists */
.cxp-fields-list { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.cxp-fields-list::-webkit-scrollbar, .cxp-builder-area::-webkit-scrollbar { width: 4px; }
.cxp-fields-list::-webkit-scrollbar-thumb, .cxp-builder-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.fld-item { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; display: flex; align-items: center; gap: 12px; cursor: grab; transition: 0.2s; }
.fld-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(192,132,252,0.3); }
.fld-drag { color: rgba(255,255,255,0.3); }
.fld-item:hover .fld-drag { color: #fff; }

.cxp-builder-area { flex-grow: 1; overflow-y: auto; background: rgba(0,0,0,0.2); position: relative; }
.cxp-empty-dropzone { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: rgba(255,255,255,0.3); font-size: 0.9rem; font-weight: 600; text-align: center; border: 2px dashed rgba(255,255,255,0.1); border-radius: 12px; }
.cxp-empty-dropzone.drag-over { border-color: #c084fc; background: rgba(192,132,252,0.1); color: #c084fc; }

.cxp-schema-list { display: flex; flex-direction: column; gap: 8px; }
.sch-row { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-left: 3px solid #06b6d4; padding: 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-size: 0.8rem; cursor: grab; animation: popIn 0.2s ease-out; }
.sch-row input { flex: 1; background: rgba(0,0,0,0.5); border: 1px solid transparent; color: #fff; padding: 6px 8px; border-radius: 4px; outline: none; font-size: 0.8rem; transition: 0.2s; }
.sch-row input:focus { border-color: #c084fc; }
.sch-lbl-orig { color: rgba(255,255,255,0.5); width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Preview Area */
.cxp-preview-area { flex-grow: 1; overflow-y: auto; background: #000; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.cxp-code-preview { margin: 0; font-family: monospace; font-size: 0.8rem; color: #fbbf24; white-space: pre-wrap; word-break: break-all; }
.cxp-table-wrap { overflow-x: auto; }
.cxp-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; white-space: nowrap; }
.cxp-table th { text-align: left; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); background: #0d0b12; position: sticky; top: 0; }
.cxp-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; }

/* Modals */
.cxp-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.cxp-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.cxp-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.cxp-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.cxp-modal__close:hover { color: white; }

.cxp-alert { padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; display: flex; align-items: center; gap: 12px; color: #fff; }