page-manager {
    display: contents;
}

.page-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.page-manager-container {
    background-color: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.page-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: white;
    border-radius: 0.75rem 0.75rem 0 0;
}

.page-manager-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.close-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background-color: #f5f5f5;
}

.close-button svg {
    width: 24px;
    height: 24px;
}

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

.page-manager-sidebar {
    width: 320px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.page-manager-actions {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#create-page-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #702A2A;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

#create-page-btn:hover {
    background-color: #5a1f1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 42, 42, 0.4);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

#page-search {
    width: 100%;
    padding: 0.75rem 2.25rem 0.75rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

#page-search:focus {
    outline: none;
    border-color: #702A2A;
    box-shadow: 0 0 0 3px rgba(112, 42, 42, 0.1);
}

.search-container svg {
    position: absolute;
    right: 10px;
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: #999;
}

.page-manager-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.page-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.page-item:hover {
    background-color: #f5f5f5;
}

.page-item.active {
    background-color: #fff8f8;
    border-left: 3px solid #702A2A;
    padding-left: calc(0.75rem - 3px);
}

.page-info {
    flex: 1;
    min-width: 0;
}

.page-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
}

.page-status.published {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.page-status.draft {
    background-color: #fff3cd;
    color: #856404;
}

.page-status.archived {
    background-color: #eceff1;
    color: #455a64;
}

.page-manager-editor {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #fafafa;
    padding: 2rem;
}

.editor-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #999;
}

.editor-empty-state svg {
    width: 3rem;
    height: 3rem;
}

.editor-empty-state p {
    margin: 0;
    font-size: 1rem;
}

.editor-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    box-sizing: border-box;
    background-color: #fafafa;
}

.editor-form {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #702A2A;
    box-shadow: 0 0 0 3px rgba(112, 42, 42, 0.1);
}

.form-group input[type="text"]:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #702A2A;
}

.form-group.checkbox label {
    font-weight: 400;
    margin: 0;
}

.editor-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
}

.btn-primary {
    background-color: #702A2A;
    color: white;
}

.btn-primary:hover {
    background-color: #5a1f1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 42, 42, 0.4);
}

.btn-secondary {
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: #702A2A;
}

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

.btn-danger:hover {
    background-color: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

#seo-page-btn {
    background-color: white;
    color: #702A2A;
    border: 2px solid #702A2A;
    font-weight: 700;
    text-wrap: nowrap;
}

#seo-page-btn:hover {
    background-color: #702A2A;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 42, 42, 0.3);
}

.btn-primary svg,
.btn-secondary svg,
.btn-danger svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-manager-container {
        max-width: 95vw;
        height: 95vh;
    }

    .page-manager-content {
        flex-direction: column;
    }

    .page-manager-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .page-manager-editor {
        height: 60%;
    }

    .editor-content {
        padding: 1rem;
    }

    .editor-form {
        max-width: none;
    }

    .editor-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
}

/* Scrollbar styling */
.page-manager-list::-webkit-scrollbar,
.editor-content::-webkit-scrollbar {
    width: 8px;
}

.page-manager-list::-webkit-scrollbar-track,
.editor-content::-webkit-scrollbar-track {
    background: transparent;
}

.page-manager-list::-webkit-scrollbar-thumb,
.editor-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.page-manager-list::-webkit-scrollbar-thumb:hover,
.editor-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Modal Styles for PageManager */
#page-manager-modal {
    --modal-bg: white;
    --modal-border: #e0e0e0;
    --modal-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    --text-color: #333;
    --primary-color: #702A2A;
}

#page-manager-modal .modal-body {
    margin-bottom: 1.5rem;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-form-group:last-child {
    margin-bottom: 0;
}

.modal-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.modal-form-group input[type="text"] {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.modal-form-group input[type="text"]:focus {
    outline: none;
    border-color: #702A2A;
    box-shadow: 0 0 0 3px rgba(112, 42, 42, 0.1);
}

/* Modal Buttons */
#page-manager-modal .btn-confirm {
    background: #702A2A;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

#page-manager-modal .btn-confirm:hover {
    background: #5a1f1f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 42, 42, 0.4);
}

#page-manager-modal .btn-cancel {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

#page-manager-modal .btn-cancel:hover {
    background: #f5f5f5;
    border-color: #702A2A;
}

#page-manager-modal .btn-danger-confirm {
    background: #f44336;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

#page-manager-modal .btn-danger-confirm:hover {
    background: #da190b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}