* { box-sizing: border-box; }
.designer-wrap {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1e1e2e;
    color: #cdd6f4;
    direction: rtl;
}
.designer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-wrap: wrap;
}
.designer-toolbar a, .designer-toolbar button {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #45475a;
    background: #313244;
    color: #cdd6f4;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.designer-toolbar a:hover, .designer-toolbar button:hover {
    background: #45475a;
}
.designer-toolbar select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
}
.designer-body {
    flex: 1;
    display: flex;
    min-height: 0;
}
.designer-side-left {
    width: 200px;
    background: #181825;
    border-left: 1px solid #313244;
    padding: 0.75rem;
    overflow-y: auto;
}
.designer-side-left h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #a6adc8;
}
.designer-side-left button {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px dashed #45475a;
    background: transparent;
    color: #cdd6f4;
    cursor: pointer;
}
.designer-side-left button:hover {
    background: #313244;
}
.designer-canvas-wrap {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    background: #11111b;
}
.designer-canvas {
    min-height: 400px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.designer-side-right {
    width: 320px;
    background: #181825;
    border-right: 1px solid #313244;
    overflow-y: auto;
    padding: 0.75rem;
}
.designer-side-right.props-sticky {
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}
.designer-canvas-wrap {
    position: relative;
}
.canvas-resize-handle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 12px;
    background: rgba(100,100,120,0.5);
    border-radius: 6px 6px 0 0;
    cursor: ns-resize;
    z-index: 5;
}
.canvas-resize-handle:hover { background: rgba(100,100,120,0.8); }
.element-buttons-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0.5rem; }
.element-buttons-row button { flex: 1; min-width: 50px; margin-bottom: 0; }
.element-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 0.3rem;
    font-size: 0.9rem;
    color: #a6adc8;
}
.element-list-actions { display: flex; gap: 4px; }
.element-list-actions button { width: 28px; height: 28px; margin: 0; padding: 0; font-size: 1.1rem; line-height: 1; }
.anim-props-list { max-height: 120px; overflow-y: auto; border: 1px solid #45475a; border-radius: 4px; padding: 0.3rem; margin: 0.3rem 0; }
.anim-props-list label { display: inline-flex; align-items: center; margin: 2px 6px 2px 0; }
.grad-stop { display: flex; gap: 4px; margin: 4px 0; align-items: center; }
.grad-stop input[type="color"] { width: 36px; height: 28px; }
.grad-stop input[type="text"] { width: 60px; }
.btn-gradient-builder, .btn-font-mgr { margin: 0.3rem 0; padding: 0.4rem; font-size: 0.85rem; }
.designer-side-right h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #a6adc8;
}
.designer-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0.5rem;
}
.designer-tabs button {
    flex: 1;
    padding: 0.4rem;
    border: none;
    border-radius: 4px;
    background: #313244;
    color: #a6adc8;
    cursor: pointer;
    font-size: 0.8rem;
}
.designer-tabs button.active {
    background: #45475a;
    color: #cdd6f4;
}
.designer-props {
    display: grid;
    gap: 0.5rem;
}
.designer-props label {
    display: block;
    font-size: 0.8rem;
    color: #a6adc8;
}
.designer-props input, .designer-props select, .designer-props textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #45475a;
    background: #313244;
    color: #cdd6f4;
    font-size: 0.85rem;
}
.designer-props .props-section { margin-bottom: 1rem; border-bottom: 1px solid #313244; padding-bottom: 0.5rem; }
.designer-props .props-section h4 { font-size: 0.8rem; color: #89b4fa; margin: 0.5rem 0 0.3rem; }
.prop-size, .prop-four, .prop-color, .prop-range, .prop-boxshadow-simple { display: grid; gap: 0.3rem; }
.prop-size { grid-template-columns: 1fr auto; }
.prop-size input[type="number"] { min-width: 0; }
.prop-size select { width: 70px; }
.prop-four { grid-template-columns: auto 1fr; }
.prop-four label { font-size: 0.75rem; }
.prop-color { grid-template-columns: auto 1fr; }
.prop-color input[type="color"] { width: 40px; height: 28px; padding: 2px; cursor: pointer; }
.prop-range { grid-template-columns: 1fr auto; }
.prop-range input[type="range"] { min-width: 0; }
.prop-range .range-val { font-size: 0.8rem; min-width: 40px; }
.prop-boxshadow-simple { grid-template-columns: auto 1fr auto 1fr auto 1fr; }
.prop-boxshadow-simple input[type="color"] { width: 36px; height: 24px; padding: 1px; }
.designer-props .btn-add-child { margin-top: 0.5rem; width: 100%; padding: 0.5rem; border-radius: 6px; border: 1px dashed #45475a; background: transparent; color: #a6adc8; cursor: pointer; }
.designer-props .btn-add-child:hover { background: #313244; }
.designer-props .btn-delete-element { margin-top: 0.3rem; width: 100%; padding: 0.5rem; border-radius: 6px; border: 1px solid #f38ba8; background: transparent; color: #f38ba8; cursor: pointer; }
.designer-props .btn-delete-element:hover { background: rgba(243,139,168,0.2); }
.designer-element {
    position: absolute;
    cursor: move;
    outline: 2px dashed transparent;
    transition: outline-color 0.15s;
}
.designer-element.selected {
    outline-color: #e94560;
    z-index: 10;
}
.designer-element .resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #e94560;
    bottom: 0;
    left: 0;
    cursor: nwse-resize;
}
.designer-element-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.designer-element-list li {
    padding: 0.35rem 0.5rem;
    margin-bottom: 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.designer-element-list li:hover { background: #313244; }
.designer-element-list li.selected { background: #45475a; }
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: #181825;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid #313244;
}
.modal-box h3 { margin-top: 0; }
.modal-box input, .modal-box textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border: 1px solid #45475a;
    background: #313244;
    color: #cdd6f4;
}
.modal-actions { margin-top: 1rem; }
.modal-actions button {
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}
.modal-actions button.primary { background: #e94560; color: #fff; }
.section-title {
    font-size: 0.85rem;
    margin: 1rem 0 0.5rem;
    color: #a6adc8;
    border-bottom: 1px solid #313244;
    padding-bottom: 0.25rem;
}
