/* Editor Layout */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #1a1a2e;
}

/* Header */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    min-height: 60px;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-center {
    flex-direction: column;
    gap: 6px;
}

.header-center-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timeline-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

#timeline-slider {
    width: 220px;
}

.timeline-label {
    color: #cbd5f5;
    font-size: 12px;
}

#play-btn.is-playing {
    background: #ef4444;
    color: #fff;
}

#play-btn.is-playing:hover {
    background: #dc2626;
}

.back-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: #fff;
}

.template-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    width: 200px;
}

.template-name-input:hover, .template-name-input:focus {
    border-color: #0f3460;
    background: #1a1a2e;
    outline: none;
}

.preset-select {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.canvas-size {
    color: #94a3b8;
    font-size: 13px;
}

/* Main Editor Area */
.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    width: 60px;
    background: #16213e;
    border-right: 1px solid #0f3460;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #1a1a2e;
    color: #fff;
}

.tool-btn.active {
    background: #7b2cbf;
    color: #fff;
}

.tool-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tool-divider {
    width: 30px;
    height: 1px;
    background: #0f3460;
    margin: 10px 0;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    overflow: auto;
    padding: 40px;
}

.canvas-wrapper {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
}

#editor-canvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 200px);
}

.inline-text-editor {
    position: absolute;
    z-index: 5;
    padding: 6px 8px;
    border: 1px solid #7b2cbf;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Right Panel */
.right-panel {
    width: 280px;
    background: #16213e;
    border-left: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel {
    border-bottom: 1px solid #0f3460;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #1a1a2e;
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 5px;
}

.icon-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.icon-btn:hover {
    background: #0f3460;
    color: #fff;
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.panel-content {
    padding: 15px;
}

.panel-content .hint {
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* Form Elements in Panel */
.panel-content .form-group {
    margin-bottom: 12px;
}

.panel-content label {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.panel-content input[type="text"],
.panel-content input[type="number"],
.panel-content select {
    width: 100%;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.panel-content input[type="color"] {
    width: 100%;
    height: 32px;
    padding: 2px;
    border: 1px solid #0f3460;
    border-radius: 4px;
    cursor: pointer;
}

.panel-content input[type="range"] {
    width: calc(100% - 40px);
}

.panel-content input:focus, .panel-content select:focus {
    outline: none;
    border-color: #7b2cbf;
}

.panel-content input:disabled,
.panel-content select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Layers List */
.layers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.layers-list li {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    gap: 8px;
}

.layers-list li:hover {
    background: #1a1a2e;
}

.layers-list li.selected {
    background: #7b2cbf;
    color: #fff;
}

.layers-list .layer-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.layers-list .layer-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layers-list .layer-opacity {
    font-size: 11px;
    color: #64748b;
    background: #1a1a2e;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    min-width: 28px;
    text-align: center;
}

.layers-list .layer-opacity:hover {
    background: #0f3460;
    color: #fff;
}

.layers-list li.selected .layer-opacity {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.layers-list li.locked {
    opacity: 0.8;
}

.layer-opacity-input {
    width: 40px !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    text-align: center;
    background: #1a1a2e !important;
    border: 1px solid #7b2cbf !important;
}

.layers-list .layer-visibility {
    opacity: 0.5;
    cursor: pointer;
}

.layers-list .layer-lock {
    opacity: 0.6;
    cursor: pointer;
}

.layers-list .layer-lock:hover {
    opacity: 1;
}

.layers-list .layer-visibility:hover {
    opacity: 1;
}

/* Row with multiple inputs */
.input-row {
    display: flex;
    gap: 10px;
}

.input-row .form-group {
    flex: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #16213e;
    border-radius: 12px;
    padding: 30px;
    width: 400px;
    max-width: 90%;
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 20px;
}

.modal-content .hint {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 12px;
}

.modal-content .hint code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content label {
    display: block;
    color: #94a3b8;
    margin-bottom: 5px;
    font-size: 13px;
}

.modal-content input, .modal-content select, .modal-content textarea {
    width: 100%;
    padding: 10px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
}

.modal-content textarea {
    resize: vertical;
    min-height: 140px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
}

.chip:hover {
    border-color: #7b2cbf;
    color: #fff;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.custom-size {
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-size input {
    width: 100px !important;
}

/* Button Styles for Editor */
.editor-header .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary {
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 900px) {
    .right-panel {
        display: none;
    }
}

/* Color picker inline */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input-wrapper input[type="color"] {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
}

/* Font Selector */
#prop-fontFamily {
    max-height: 300px;
}

#prop-fontFamily optgroup {
    color: #7b2cbf;
    font-weight: bold;
    background: #16213e;
    padding: 5px 0;
}

#prop-fontFamily option {
    color: #fff;
    background: #1a1a2e;
    padding: 5px 10px;
}

/* Data Table Modal */
.modal-large {
    width: 800px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large .hint {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 15px;
}

.modal-large .hint code {
    background: #1a1a2e;
    padding: 2px 6px;
    border-radius: 3px;
    color: #7b2cbf;
}

.table-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545 !important;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
    max-height: 400px;
    background: #1a1a2e;
    border-radius: 6px;
    margin-bottom: 15px;
}

#data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#data-table th,
#data-table td {
    border: 1px solid #0f3460;
    padding: 0;
}

#data-table th {
    background: #0f3460;
    position: sticky;
    top: 0;
    z-index: 1;
}

#data-table th input,
#data-table td input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
}

#data-table th input {
    font-weight: bold;
    color: #7b2cbf;
}

#data-table th input:focus,
#data-table td input:focus {
    outline: none;
    background: rgba(123, 44, 191, 0.1);
}

#data-table .row-number {
    width: 40px;
    text-align: center;
    color: #64748b;
    background: #16213e;
    padding: 8px;
}

#data-table .delete-row {
    width: 30px;
    text-align: center;
    cursor: pointer;
    color: #64748b;
    background: #16213e;
}

#data-table .delete-row:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

#data-table .delete-col {
    cursor: pointer;
    color: #64748b;
}

#data-table .delete-col:hover {
    color: #dc3545;
}

/* Series Navigation */
#series-navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.series-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #0f3460;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.series-nav-btn:hover {
    background: #7b2cbf;
}

.series-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#series-counter {
    color: #fff;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

#series-close-btn {
    background: #dc3545;
}
