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

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

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.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;
}

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

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 1rem;
}

.panel {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.panel:last-child {
    border-bottom: none;
}

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

.content-controls label,
.appearance-controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.content-controls input,
.content-controls textarea,
.appearance-controls input,
.appearance-controls select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.content-controls textarea {
    resize: vertical;
    min-height: 80px;
}

.layout-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layout-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.layout-options label:hover {
    background-color: #f8f9fa;
}

.layout-options input[type="radio"] {
    margin: 0;
}

.appearance-controls input[type="range"] {
    margin-bottom: 0.5rem;
}

#fontSizeValue {
    font-size: 0.9rem;
    color: #666;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: inline-block;
}

.color-preview small {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.5rem;
}

.gray-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.gray-controls input[type="radio"] {
    display: none;
}

.gray-option {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: inline-block;
}

.gray-option:hover {
    transform: scale(1.1);
}

.gray-controls input[type="radio"]:checked + .gray-option {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.gray-option.white {
    background: #ffffff;
    border: 2px solid #ddd;
}

.gray-option.light {
    background: #f8f9fa;
}

.gray-option.medium {
    background: #6c757d;
}

.gray-option.dark {
    background: #343a40;
}

.gray-option.black {
    background: #000000;
}

.navigation-controls {
    margin-bottom: 1rem;
}

.nav-link-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.nav-link-text,
.nav-link-anchor {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.nav-link-anchor {
    font-family: monospace;
    color: #666;
}

.remove-nav-link {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-nav-link:hover {
    background: #c0392b;
}

.btn-add {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    width: 100%;
}

.btn-add:hover {
    background: #219a52;
}

.components {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.component-btn {
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.component-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.preview-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.preview-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
}

#preview {
    flex: 1;
    border: none;
    background: white;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .actions {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}