@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hamburger-btn:hover {
    background: #34495e;
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.hamburger-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.hamburger-dropdown.show {
    display: flex;
}

.menu-item {
    padding: 12px 16px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
    border-bottom: 1px solid #ecf0f1;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8f9fa;
    color: #3498db;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Alignment Toolbar */
.alignment-toolbar {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-label {
    font-size: 0.85rem;
    color: #5a6c7d;
    font-weight: 500;
    margin-right: 0.25rem;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #ddd;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #2c3e50;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #6200ee;
    color: #6200ee;
}

.btn-icon:active {
    background: #e9ecef;
}

.btn-icon svg {
    display: block;
}

/* Main Container */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Component Palette */
.palette {
    width: 250px;
    background: white;
    border-right: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.palette h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

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

.component-group h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.component-item {
    background: #ecf0f1;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.component-item:hover {
    background: #3498db;
    color: white;
    transform: translateX(4px);
}

.component-icon {
    font-size: 1.2rem;
}

/* Canvas */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e8e8e8;
    padding: 2rem;
    overflow: auto;
}

.canvas {
    background: white;
    min-height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

.canvas.drag-over {
    background: #f8f9fa;
    border: 2px dashed #3498db;
}

/* Dropped Components */
.dropped-component {
    position: absolute;
    padding: 0.5rem;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
    cursor: move;
    min-width: 100px;
    min-height: 40px;
}

.dropped-component:hover {
    border-color: #3498db;
}

.dropped-component.selected {
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.dropped-component.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.dropped-component.dragging > * {
    pointer-events: none;
}

.component-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 10;
}

.dropped-component:hover .component-delete {
    display: flex;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border: 1px solid white;
    display: none;
    z-index: 10;
}

.dropped-component.selected .resize-handle {
    display: block;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.resize-handle.e {
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.resize-handle.w {
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

/* Properties Panel */
.properties-panel {
    width: 300px;
    background: white;
    border-left: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.properties-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

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

.property-group label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.property-group input,
.property-group select,
.property-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.property-group textarea {
    resize: vertical;
    min-height: 60px;
}

.property-group input[type="color"] {
    height: 40px;
    padding: 0.25rem;
    cursor: pointer;
}

/* Component Styles */
.dropped-component > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Material Design Components */
.ui-button {
    padding: 0.625rem 1rem;
    background: #6200ee;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.0892857143em;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.14), 0 3px 4px rgba(0,0,0,0.12), 0 1px 5px rgba(0,0,0,0.2);
    transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.16), 0 6px 8px rgba(0,0,0,0.14), 0 2px 10px rgba(0,0,0,0.22);
}

.ui-input {
    width: 100%;
    height: 100%;
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.42);
    border-radius: 4px 4px 0 0;
    background: rgba(0,0,0,0.04);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-bottom-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-input:focus {
    outline: none;
    border-bottom: 2px solid #6200ee;
    background: rgba(0,0,0,0.08);
}

.ui-text {
    font-size: 1rem;
    color: rgba(0,0,0,0.87);
    line-height: 1.5;
    width: 100%;
    height: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ui-heading {
    font-size: 2rem;
    font-weight: 400;
    color: rgba(0,0,0,0.87);
    line-height: 1.25;
    width: 100%;
    height: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ui-container {
    padding: 1rem;
    border: 1px dashed rgba(0,0,0,0.12);
    border-radius: 4px;
    width: 100%;
    height: 100%;
    min-height: 100px;
    box-sizing: border-box;
    background: rgba(0,0,0,0.02);
}

.ui-card {
    padding: 1rem;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 1px -1px rgba(0,0,0,0.2), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: white;
}

.ui-image {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0,0,0,0.38);
    box-sizing: border-box;
}

.ui-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
}

.ui-checkbox input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #6200ee;
}

.ui-checkbox label {
    color: rgba(0,0,0,0.87);
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}

.ui-radio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    height: 100%;
}

.ui-radio input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #6200ee;
}

.ui-radio label {
    color: rgba(0,0,0,0.87);
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
}

.ui-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.ui-toggle .toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ui-toggle .toggle-slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 14px;
    background-color: rgba(0,0,0,0.38);
    border-radius: 7px;
    transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.ui-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: -3px;
    top: -3px;
    background-color: #fafafa;
    border-radius: 50%;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 1px -1px rgba(0,0,0,0.2), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
}

.ui-toggle .toggle-input:checked + .toggle-slider {
    background-color: rgba(98,0,238,0.5);
}

.ui-toggle .toggle-input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background-color: #6200ee;
}

.ui-toggle .toggle-label {
    user-select: none;
    color: rgba(0,0,0,0.87);
    font-size: 1rem;
}

.ui-divider {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.12);
}

.ui-spacer {
    width: 100%;
    height: 100%;
    min-height: 20px;
}

.ui-list {
    width: 100%;
    height: auto;
    padding: 16px;
    margin: 0;
    list-style-position: inside;
    background: white;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
}

.ui-list li {
    padding: 8px 0;
    color: rgba(0,0,0,0.87);
    font-size: 14px;
    line-height: 1.5;
}

.ui-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid rgba(0,0,0,0.12);
}

.ui-table thead {
    background: rgba(0,0,0,0.05);
}

.ui-table th {
    padding: 12px;
    text-align: left;
    font-weight: 500;
    color: rgba(0,0,0,0.87);
    border-bottom: 2px solid rgba(0,0,0,0.12);
    font-size: 14px;
}

.ui-table td {
    padding: 12px;
    color: rgba(0,0,0,0.87);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 14px;
}

.ui-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

.ui-table tbody tr:hover {
    background: rgba(0,0,0,0.04);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #95a5a6;
    padding: 4rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}
