/* Project Content Editor Styles */

.project-edit-btn {
    position: fixed;
    top: 60px;
    right: 12px;
    z-index: 1000;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.project-edit-btn:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.page-manage-btn {
    display: inline-block;
    margin: 20px 0;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-manage-btn:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#content-editor-panel,
#page-editor-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e6e6e6;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    overflow-x: hidden;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e6e6e6;
    background: #f9f9f9;
}

.editor-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.editor-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
    transition: color 0.2s;
}

.editor-close-btn:hover {
    color: #111;
}

.editor-stats {
    padding: 12px 20px;
    background: #f4f4f4;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.editor-stats .stat strong {
    color: #111;
    font-weight: 600;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.editor-add-buttons {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.btn-add-block {
    width: 100%;
    padding: 10px 16px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-block:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-add-text,
.btn-add-image {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #ddd;
    background: #fff;
}

.btn-add-text:hover {
    background: #f0f9ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-add-image:hover {
    background: #f0fdf4;
    border-color: #10b981;
    color: #10b981;
}

.add-block-form {
    padding: 16px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e6e6e6;
}

.add-block-form h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input[type="file"] {
    padding: 6px;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-add,
.btn-cancel-form {
    flex: 0 1 auto;
    min-width: 90px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add {
    background: #10b981;
    color: #fff;
    border: 1px solid #10b981;
}

.btn-add:hover {
    background: #059669;
    border-color: #059669;
}

.btn-cancel-form {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.btn-cancel-form:hover {
    background: #f4f4f4;
    border-color: #bbb;
}

.blocks-list {
    flex: 0 0 auto;
    padding: 12px;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.block-item:hover {
    border-color: #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.block-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    flex-shrink: 0;
}

.block-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.block-info {
    flex: 1;
    min-width: 0;
}

.block-type {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 2px;
}

.block-preview {
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.block-controls button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.block-controls button:hover:not(:disabled) {
    background: #f4f4f4;
    border-color: #bbb;
}

.block-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.block-controls .btn-delete {
    color: #e53e3e;
}

.block-controls .btn-delete:hover:not(:disabled) {
    background: #fff5f5;
    border-color: #fc8181;
}

.block-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.block-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.block-actions .btn-icon:hover:not(:disabled) {
    background: #f4f4f4;
    border-color: #bbb;
}

.block-actions .btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.block-actions .btn-delete {
    color: #e53e3e;
}

.block-actions .btn-delete:hover:not(:disabled) {
    background: #fff5f5;
    border-color: #fc8181;
}

.editor-actions {
    padding: 16px 20px;
    border-top: 1px solid #e6e6e6;
    background: #f9f9f9;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.editor-actions button {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save {
    background: #111;
    color: #fff;
    border: 1px solid #111;
}

.btn-save:hover:not(:disabled) {
    background: #333;
    border-color: #333;
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cancel {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #f4f4f4;
    border-color: #bbb;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #111;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    animation: slideInUp 0.3s ease, fadeOut 0.3s ease 2.7s;
    pointer-events: none;
}

.toast-notification.success {
    background: #10b981;
}

.toast-notification.error {
    background: #ef4444;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
