@import url('fonts.css');
/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}
a { text-decoration: none; color: #2563eb; }

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}
.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    text-align: center;
}
.login-box .subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 24px;
}
.login-box .hint {
    margin-top: 16px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* ===== Navbar ===== */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand a, .nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}
.nav-steps {
    display: flex;
    gap: 24px;
}
.nav-steps .step {
    font-size: 13px;
    color: #9ca3af;
    position: relative;
}
.nav-steps .step.active {
    color: #2563eb;
    font-weight: 600;
}
.nav-steps .step.completed {
    color: #10b981;
}
.nav-steps .step::after {
    content: '>';
    position: absolute;
    right: -16px;
    color: #d1d5db;
}
.nav-steps .step:last-child::after { display: none; }
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-success {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
.btn-outline {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
}
.btn-outline:hover { background: #f3f4f6; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #374151;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* ===== Dashboard ===== */
.dashboard h1 { margin-bottom: 8px; }
.dashboard .lead {
    color: #6b7280;
    margin-bottom: 32px;
}
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.card-action {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    color: inherit;
}
.card-action:hover {
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.card-action h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1f2937;
}
.card-action p {
    color: #6b7280;
    font-size: 14px;
}

/* ===== Editor ===== */
.editor-step {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    border: 1px solid #e5e7eb;
}
.editor-step h2 {
    margin-bottom: 24px;
    font-size: 20px;
}
.step-actions {
    margin-top: 32px;
    display: flex;
    justify-content: space-between;
}

/* Product Info Form */
.cover-images-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}
.cover-images-upload:hover {
    border-color: #2563eb;
    background: #eff6ff;
}
.cover-images-upload.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}
.cover-preview {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.cover-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.cover-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-preview-item .remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
}

/* Logo Selector */
.logo-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.logo-preview {
    width: 150px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 4px;
}

/* Section Selection */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.section-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}
.section-checkbox:hover {
    border-color: #2563eb;
    background: #eff6ff;
}
.section-checkbox input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}
.section-checkbox.checked {
    border-color: #2563eb;
    background: #eff6ff;
}
.section-checkbox .section-type {
    font-size: 11px;
    color: #6b7280;
    margin-left: auto;
    text-transform: uppercase;
}

/* Content Editor */
.content-editor-step {
    margin-bottom: 24px;
}
.content-editor-step h3 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}
.editor-type-label {
    display: inline-block;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

/* Image Editor */
.image-group {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
}
.image-group .image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 12px;
}
.image-group .image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* List Editor */
.list-items {
    margin-bottom: 12px;
}
.list-item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.list-item-row input {
    flex: 1;
}
.list-item-row .btn-remove {
    padding: 4px 8px;
    font-size: 12px;
}

/* Panel Editor */
.panel-editor .panel-image-upload {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 16px;
}
.panel-editor .interface-rows {
    margin-bottom: 12px;
}
.panel-editor .interface-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

/* Others Subsections */
.others-subsection {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
}
.others-subsection-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.others-subsection-header input {
    flex: 1;
}

/* Review Page */
.review-page h1 {
    margin-bottom: 8px;
}
.review-page h1 small {
    color: #6b7280;
    font-weight: normal;
}
.review-info {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.review-info p {
    margin-bottom: 4px;
}
.review-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}
.review-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.review-actions {
    margin-top: 32px;
    text-align: center;
}

/* History List */
.manuals-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.manuals-table th,
.manuals-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.manuals-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7280;
}
.manuals-table tr:last-child td {
    border-bottom: none;
}
.manuals-table .actions {
    display: flex;
    gap: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}
.pagination button {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}
.pagination button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Version Hint */
.version-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}
.version-hint .highlight {
    color: #2563eb;
    font-weight: 600;
}

/* ===== Editor Tabs ===== */
.editor-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}
.editor-tab {
    padding: 8px 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}
.editor-tab:hover {
    background: #e5e7eb;
}
.editor-tab.active {
    background: #2563eb;
    color: #fff;
}

/* ===== Markdown Preview Box ===== */
.markdown-preview-box {
    min-height: 500px;
    padding: 20px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0 6px 6px 6px;
    font-size: 14px;
    line-height: 1.8;
    overflow-y: auto;
}
.markdown-preview-box h2 {
    font-size: 20px;
    margin: 16px 0 8px;
}
.markdown-preview-box h3 {
    font-size: 16px;
    margin: 12px 0 6px;
}
.markdown-preview-box ul {
    margin: 8px 0;
    padding-left: 24px;
}
.markdown-preview-box li {
    margin: 4px 0;
}

/* ===== EasyMDE Override - Bigger Editor ===== */
.EasyMDEContainer {
    min-height: 500px !important;
}
.EasyMDEContainer .CodeMirror {
    min-height: 500px !important;
    font-size: 15px;
    line-height: 1.8;
}
.editor-toolbar {
    border-radius: 6px 6px 0 0;
}
.CodeMirror-scroll {
    min-height: 500px !important;
}

/* ===== Modal Content - Wider ===== */
.modal-content {
    max-width: 900px !important;
    width: 90vw;
}

/* ===== Content Editor Area ===== */
.editor-content-area {
    width: 100%;
}
.content-editor-step {
    width: 100%;
}
.editor-step {
    max-width: 100%;
}
