/* UNIFLASH - Editor Styles */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #1e293b;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);

    --toolbar-height: 60px;
    --sidebar-width: 280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg-alt);
    overflow: hidden;
    height: 100vh;
}

/* Toolbar */
.toolbar {
    height: var(--toolbar-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 2rem;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo i {
    font-size: 1.5rem;
}

.divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}

.project-name {
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem;
    min-width: 200px;
    border-radius: 0.25rem;
}

.project-name:focus {
    outline: none;
    background: var(--bg-alt);
}

.save-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-size: 0.875rem;
}

.tool-group {
    display: flex;
    gap: 0.25rem;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover:not(:disabled) {
    background: var(--bg-alt);
    border-color: var(--primary);
}

.tool-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.zoom-display {
    min-width: 60px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-primary,
.btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-alt);
}

/* Main Layout */
.main-layout {
    display: flex;
    height: calc(100vh - var(--toolbar-height));
}

/* Sidebars */
.sidebar-left,
.sidebar-right {
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Symbols */
.symbols-categories {
    flex: 1;
    overflow-y: auto;
}

.category {
    border-bottom: 1px solid var(--border);
}

.category-header {
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.category-header:hover {
    background: #e2e8f0;
}

.category-header i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.category.collapsed .category-header i {
    transform: rotate(-90deg);
}

.symbols-list {
    padding: 0.5rem;
}

.category.collapsed .symbols-list {
    display: none;
}

.symbol-item {
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.symbol-item:hover {
    background: var(--bg-alt);
}

.symbol-item:active {
    cursor: grabbing;
}

.symbol-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.symbol-item span {
    font-size: 0.875rem;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    background: #e5e7eb;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
}

.canvas-container {
    width: 100%;
    height: 100%;
    cursor: default;
}

/* Properties Panel */
.properties-panel {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.no-selection {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-selection i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.property-group {
    margin-bottom: 1.5rem;
}

.property-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: block;
}

.property-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.property-input:focus {
    outline: none;
    border-color: var(--primary);
}

select.property-input {
    cursor: pointer;
}

/* Validation Panel */
.validation-panel {
    border-top: 1px solid var(--border);
    max-height: 40%;
}

#validationResults {
    padding: 1rem;
}

.validation-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    border-left: 3px solid;
    font-size: 0.875rem;
}

.validation-item.error {
    background: #fef2f2;
    border-color: var(--danger);
}

.validation-item.warning {
    background: #fffbeb;
    border-color: var(--warning);
}

.validation-item.info {
    background: #eff6ff;
    border-color: var(--primary);
}

.validation-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Export Options */
.export-options {
    display: grid;
    gap: 1rem;
}

.export-option {
    cursor: pointer;
}

.export-option input {
    display: none;
}

.option-content {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.option-content i {
    font-size: 2rem;
    color: var(--primary);
}

.option-content strong {
    font-size: 1rem;
}

.option-content span {
    font-size: 0.875rem;
    color: var(--text-light);
    display: block;
}

.export-option:hover .option-content {
    border-color: var(--primary);
    background: var(--bg-alt);
}

.export-option input:checked + .option-content {
    border-color: var(--primary);
    background: #eff6ff;
}

.export-option.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
