/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 15px;
    color: #2c3e50;
}

nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: #ecf0f1;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #bdc3c7;
}

.nav-btn.active {
    background: #3498db;
    color: white;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Form Styles */
.form-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-row input[type="text"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input[type="checkbox"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.btn-primary {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

button {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

button:hover {
    background: #7f8c8d;
}

/* Preview */
.preview-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

#preview {
    border: 1px solid #ddd;
    padding: 20px;
    background: #fafafa;
    min-height: 400px;
}

/* Templates */
.templates-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.templates-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.templates-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.template-item {
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-item:hover {
    background: #f8f9fa;
}

.template-actions {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Archive */
.archive-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.archive-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.archive-controls input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.archive-item {
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-item:hover {
    background: #f8f9fa;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .templates-container {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

