/* Prevent conflicts with theme styles */
.wcws-mgdc-container *,
.wcws-mgdc-container *::before,
.wcws-mgdc-container *::after {
    box-sizing: border-box;
}

/* Main wrapper */
.wcws-mgdc-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    font-family: inherit;
}

/* Header */
.wcws-mgdc-header {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.wcws-mgdc-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #111827;
}

/* Panels layout */
.wcws-mgdc-panels {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
}

.wcws-mgdc-panel {
    flex: 1 1 0;
    min-width: 280px;
    display: flex;
    flex-direction: column;
}

.wcws-mgdc-panel-left,
.wcws-mgdc-panel-right {
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Panel headers */
.wcws-mgdc-panel-header {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Textarea styling */
.wcws-mgdc-input {
    width: 100%;
    border: none;
    padding: 0.9rem;
    resize: vertical;
    min-height: 320px;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
        "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #111827;
    background-color: #fefefe;
    border-radius: 0 0 6px 6px;
    outline: none;
}

.wcws-mgdc-input:focus {
    box-shadow: 0 0 0 1px #2563eb inset;
}

/* Preview area */
.wcws-mgdc-preview {
    padding: 0.9rem 1rem;
    min-height: 320px;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 0 0 6px 6px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #111827;
}

/* Basic formatting for rendered headings and paragraphs inside preview */
.wcws-mgdc-preview h1,
.wcws-mgdc-preview h2,
.wcws-mgdc-preview h3,
.wcws-mgdc-preview h4,
.wcws-mgdc-preview h5,
.wcws-mgdc-preview h6 {
    margin: 0 0 0.4rem;
    font-weight: 700;
}

.wcws-mgdc-preview h1 {
    font-size: 1.6rem;
}

.wcws-mgdc-preview h2 {
    font-size: 1.3rem;
}

.wcws-mgdc-preview h3 {
    font-size: 1.1rem;
}

.wcws-mgdc-preview p {
    margin: 0 0 0.7rem;
}

/* Lists */
.wcws-mgdc-preview ul,
.wcws-mgdc-preview ol {
    margin: 0 0 0.7rem 1.25rem;
    padding-left: 1rem;
}

.wcws-mgdc-preview li {
    margin-bottom: 0.25rem;
}

/* Copy button */
.wcws-mgdc-copy-btn {
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background-color: #2563eb;
    color: #ffffff;
    transition: background-color 0.15s ease, box-shadow 0.15s ease,
        transform 0.08s ease;
}

.wcws-mgdc-copy-btn:hover,
.wcws-mgdc-copy-btn:focus {
    background-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.wcws-mgdc-copy-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Small help text */
.wcws-mgdc-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #6b7280;
}

/* Responsive behaviour */
@media (max-width: 900px) {
    .wcws-mgdc-panels {
        flex-direction: column;
    }

    .wcws-mgdc-panel {
        width: 100%;
    }
}

/* Accessibility focus outlines */
.wcws-mgdc-preview:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
