/**
 * FormWiz Documentation Styles
 * 
 * THEME COLORS (change these to rebrand the entire docs page):
 * - Primary: #6b46c1 (purple)
 * - Dark: #1a1a2e (dark navy)
 * - Light Background: #f5f6fa (light gray)
 * - Light Purple: #ede9ff
 * 
 * STRUCTURE:
 * .ezwp-docs-wrap (container)
 *   ├── .ezwp-docs-nav (left sidebar)
 *   ├── .docs-tree-* (nav groups & items)
 *   └── .ezwp-docs-content (right content area)
 */

/* ================================ MAIN LAYOUT ================================ */
.ezwp-docs-wrap {
    display: flex;
    min-height: calc(100vh - 80px);
    background: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ================================ LEFT NAVIGATION ================================ */
.ezwp-docs-nav {
    width: 270px;
    min-width: 220px;
    background: #fff;
    border-right: 1px solid #e3e6f0;
    overflow-y: auto;
    padding: 20px 0 60px;
    position: sticky;
    top: 0;
    height: calc(100vh - 60px);
    flex-shrink: 0;
}

.ezwp-docs-nav-header {
    padding: 0 18px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #aaa;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.docs-tree-group {
    margin-bottom: 2px;
}

.docs-tree-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #444;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s;
}

.docs-tree-group-title:hover {
    background: #f3f0ff;
    color: #6b46c1;
}

.docs-tree-toggle {
    font-size: 0.62rem;
    transition: transform 0.2s ease;
    color: #bbb;
    flex-shrink: 0;
}

.docs-tree-group.open > .docs-tree-group-title .docs-tree-toggle {
    transform: rotate(90deg);
}

.docs-tree-items {
    display: none;
    padding: 2px 0 6px;
}

.docs-tree-group.open > .docs-tree-items {
    display: block;
}

.docs-tree-item {
    display: block;
    padding: 7px 18px 7px 34px;
    font-size: 0.82rem;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-left-color 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.docs-tree-item:hover {
    background: #f3f0ff;
    color: #6b46c1;
    text-decoration: none;
}

.docs-tree-item.active {
    background: #ede9ff;
    color: #6b46c1;
    border-left-color: #6b46c1;
    font-weight: 600;
}

/* ================================ CONTENT AREA ================================ */
.ezwp-docs-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 52px 90px;
    max-width: 900px;
    position: relative;
}

/* ================================ TYPOGRAPHY ================================ */
.ezwp-docs-content h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ezwp-docs-content .docs-subtitle {
    color: #7c7c9a;
    font-size: 1.05rem;
    margin-bottom: 28px;
    line-height: 1.5;
}

.ezwp-docs-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d2d45;
    margin: 36px 0 10px;
    border-bottom: 2px solid #ede9ff;
    padding-bottom: 6px;
}

.ezwp-docs-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #444;
    margin: 22px 0 8px;
}

.ezwp-docs-content p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 14px;
}

.ezwp-docs-content ul,
.ezwp-docs-content ol {
    margin: 0 0 14px 20px;
    color: #555;
    line-height: 1.8;
}

.ezwp-docs-content li {
    margin-bottom: 5px;
}

/* ================================ NUMBERED STEPS ================================ */
.docs-steps {
    counter-reset: step;
    list-style: none;
    margin-left: 0;
    padding: 0;
}

.docs-steps li {
    counter-increment: step;
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.docs-steps li::before {
    content: counter(step);
    min-width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.docs-steps li .step-content strong {
    display: block;
    color: #2d2d45;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.docs-steps li .step-content span {
    color: #666;
    font-size: 0.88rem;
    line-height: 1.65;
}

/* ================================ CALLOUT BOXES ================================ */
.docs-tip {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.docs-note {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e3a5f;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.docs-warn {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
    color: #7c3008;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.docs-tip strong,
.docs-note strong,
.docs-warn strong {
    display: block;
    margin-bottom: 3px;
}

/* ================================ CODE & MISC ================================ */
.ezwp-docs-content code {
    background: #f0eeff;
    color: #6b46c1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.87em;
    font-family: 'Courier New', monospace;
}

.docs-breadcrumb {
    font-size: 0.78rem;
    color: #bbb;
    margin-bottom: 16px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.docs-breadcrumb span {
    color: #6b46c1;
}

.docs-divider {
    border: none;
    border-top: 1px solid #ede8ff;
    margin: 28px 0;
}

/* ================================ TABLES ================================ */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.89rem;
    margin-bottom: 20px;
}

.docs-table thead tr {
    background: #ede9ff;
}

.docs-table th {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #c4b5fd;
    font-weight: 700;
    color: #2d2d45;
}

.docs-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0ebff;
    color: #555;
}

.docs-table tbody tr:nth-child(even) {
    background: #fdfcff;
}

/* ================================ VIDEO PLACEHOLDER ================================ */
.docs-video-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d45 100%);
    border-radius: 12px;
    aspect-ratio: 16/9;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin: 22px 0;
    border: 2px solid #3d3d60;
}

.docs-video-placeholder .play-icon {
    width: 60px;
    height: 60px;
    background: rgba(107, 70, 193, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.docs-video-placeholder p {
    color: #ccc;
    font-size: 0.88rem;
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

.docs-nav-link {
    color: #6b46c1;
    text-decoration: underline;
    cursor: pointer;
}

/* ================================ LOADING SPINNER ================================ */
.ezwp-docs-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.ezwp-spinner-ring {
    width: 42px;
    height: 42px;
    border: 4px solid #ede9ff;
    border-top-color: #6b46c1;
    border-radius: 50%;
    animation: ezwp-spin 0.7s linear infinite;
}

@keyframes ezwp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================ EDIT DRAWER (ADMIN) ================================ */
.ezwp-docs-edit-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6b46c1;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
    transition: all 0.2s;
    z-index: 1000;
}

.ezwp-docs-edit-btn:hover {
    background: #553c9a;
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.6);
    transform: scale(1.1);
}

.ezwp-docs-edit-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 60%;
    max-height: 600px;
    background: #fff;
    border-top: 1px solid #ddd;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s ease;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.5);
}

.ezwp-docs-edit-drawer.open {
    bottom: 0;
}

.ezwp-docs-edit-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    background: #2d2d45;
    color: #ccc;
    font-size: 0.84rem;
    flex-shrink: 0;
    gap: 14px;
}

.ezwp-docs-edit-drawer-header strong {
    color: #fff;
}

.ezwp-docs-edit-hint {
    font-size: 0.75rem;
    color: #888;
    flex: 1;
}

.ezwp-docs-edit-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.ezwp-docs-save-btn {
    background: #6b46c1;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 20px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ezwp-docs-save-btn:hover {
    background: #553c9a;
}

.ezwp-docs-save-btn:disabled {
    background: #888;
    cursor: not-allowed;
}

.ezwp-docs-cancel-btn {
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 7px 16px;
    font-size: 0.82rem;
    cursor: pointer;
}

.ezwp-docs-cancel-btn:hover {
    color: #fff;
    border-color: #888;
}

/* ================================ TINYMCE EDITOR OVERRIDES ================================ */
.ezwp-docs-editor-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ezwp-docs-editor-wrap .mce-tinymce.mce-container {
    width: 100% !important;
    flex: 1;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.ezwp-docs-editor-wrap .mce-container-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ezwp-docs-editor-wrap .mce-edit-area {
    flex: 1;
    min-height: 0 !important;
}

.ezwp-docs-editor-wrap .mce-edit-area iframe {
    height: 100% !important;
    display: block;
}

.ezwp-docs-html-mode {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 16px 18px;
    background: #0f0f1a;
    color: #e0e0ff;
    border: none;
    outline: none;
    resize: none;
    font: 13px/1.6 Consolas, Monaco, 'Courier New', monospace;
    box-sizing: border-box;
    overflow: auto;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp {
    width: 100% !important;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 4px 8px !important;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-container-body {
    display: block !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-flow-layout {
    display: block !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-flow-layout-item {
    display: inline-block !important;
    float: none !important;
    vertical-align: top;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-btn,
.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-btn button,
.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-listbox button {
    height: 28px !important;
    line-height: 26px !important;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-btn {
    margin: 0 2px 0 0 !important;
}

.ezwp-docs-editor-wrap .mce-toolbar-grp .mce-menubtn.mce-fixed-width span {
    width: auto !important;
    min-width: 72px;
}

.ezwp-docs-editor-wrap .mce-statusbar {
    flex-shrink: 0;
}

/* ================================ VIDEO URL PROMPT ================================ */
.ezwp-docs-video-prompt {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ezwp-docs-video-prompt-box {
    background: #2d2d45;
    border-radius: 10px;
    padding: 28px 30px;
    width: 480px;
    max-width: 92vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.ezwp-docs-video-prompt-box h4 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1rem;
}

.ezwp-docs-video-prompt-box p {
    color: #aaa;
    font-size: 0.82rem;
    margin: 0 0 16px;
}

.ezwp-docs-video-prompt-box input {
    width: 100%;
    padding: 9px 12px;
    background: #0f0f1a;
    border: 1px solid #4c3d8f;
    border-radius: 5px;
    color: #e0e0ff;
    font-size: 0.85rem;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 14px;
}

.ezwp-docs-video-prompt-box input:focus {
    border-color: #7c5cbf;
}

.ezwp-docs-video-prompt-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ================================ RESPONSIVE MOBILE ================================ */
@media (max-width: 820px) {
    .ezwp-docs-wrap {
        flex-direction: column;
    }

    .ezwp-docs-nav {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e3e6f0;
    }

    .ezwp-docs-content {
        padding: 24px 20px 60px;
    }
}
