/* FTT-DMS Help Center - Main Stylesheet */
/* Copied from prototype - see full styles in assets */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f1f5f9;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --header-bg: #ffffff;
    --content-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

body.help-page { overflow: hidden; height: 100vh; }
.help-container { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }

.help-header {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--header-bg); padding: 0 24px; height: 64px;
    box-shadow: var(--shadow-md); z-index: 100;
}

.header-left .logo { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; color: var(--primary-color); }
.header-left .logo-img { max-height: 40px; width: auto; object-fit: contain; }
.header-center { flex: 1; max-width: 600px; margin: 0 24px; }
.search-box { display: flex; align-items: center; background: var(--bg-color); border-radius: var(--radius-lg); padding: 8px 16px; border: 2px solid transparent; }
.search-box:focus-within { border-color: var(--primary-color); }
.search-box input { flex: 1; border: none; background: transparent; outline: none; }
.search-btn { background: var(--primary-color); color: white; border: none; padding: 8px 20px; border-radius: var(--radius-md); cursor: pointer; margin-left: 12px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.admin-link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); color: var(--secondary-color); text-decoration: none; }
.admin-link:hover { background: var(--bg-color); color: var(--primary-color); }

.main-wrapper { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.sidebar { width: 280px; min-height: 0; flex-shrink: 0; background: var(--sidebar-bg); color: #fff; overflow: hidden; }
.sidebar-nav { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.sidebar-header { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h3 { font-size: 0.875rem; text-transform: uppercase; color: var(--text-light); }
.menu-list { list-style: none; padding-bottom: 24px; }
.menu-item { margin-bottom: 4px; }
.menu-item > a { display: flex; align-items: center; padding: 12px 24px; color: #cbd5e1; text-decoration: none; }
.menu-item > a:hover { background: var(--sidebar-hover); color: #fff; }
.menu-item > a i:first-child { width: 24px; margin-right: 12px; }
.submenu { list-style: none; max-height: 0; overflow: hidden; transition: max-height 0.3s; background: rgba(0,0,0,0.2); }
.menu-item.open .submenu { max-height: 800px; }
.submenu li a { display: flex; align-items: center; padding: 10px 24px 10px 60px; color: #94a3b8; text-decoration: none;  gap: 10px;}
.submenu li a:hover { color: #fff; }
.submenu li a.active { color: var(--primary-color); background: rgba(37,99,235,0.1); }

.content-area { flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: var(--content-bg); display: flex; flex-direction: column; }
.content-area iframe { width: 100%; height: 100%; min-height: 0; border: none; display: block; flex: 1; }

/* Article/Module styles */
.module-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 32px 100px 32px !important;
}
.module-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid var(--border-color); }
.content-section { margin-bottom: 32px; }
.content-section h2 { font-size: 1.5rem; margin-bottom: 16px; }

/* Article rich content (Quill/HTML) */
.article-content { line-height: 1.7; }
.article-content h1, .article-content h2, .article-content h3 { margin: 24px 0 12px; font-weight: 600; }
.article-content h1 { font-size: 1.75rem; }
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.25rem; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 0 0 16px 24px; padding: 0; }
.article-content li { margin-bottom: 6px; }
.article-content img { max-width: 100%; height: auto; display: block; margin: 16px 0; border-radius: var(--radius-md); }
.article-content a { color: var(--primary-color); text-decoration: none; }
.article-content a:hover { text-decoration: underline; }
.article-content blockquote { border-left: 4px solid var(--border-color); padding: 12px 20px; margin: 16px 0; color: var(--text-secondary); background: var(--bg-color); }
.article-content pre, .article-content code { background: var(--bg-color); padding: 2px 6px; border-radius: var(--radius-sm); font-family: monospace; font-size: 0.9em; }
.article-content pre { padding: 16px; overflow-x: auto; margin: 16px 0; }
.tip-box { background: #ecfdf5; border-left: 4px solid var(--success-color); padding: 20px; border-radius: var(--radius-md); margin-bottom: 24px; }
.feature-list { list-style: none; }
.feature-list li { display: flex; gap: 12px; padding: 16px 0; }
.feature-list li i { color: var(--success-color); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { background: var(--bg-color); font-weight: 600; }

/* Admin */
.admin-container { display: flex; min-height: 100vh; }
.admin-sidebar { width: 260px; background: var(--sidebar-bg); color: white; padding: 24px 0; }
.admin-sidebar .logo { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 24px; }
.admin-nav ul { list-style: none; }
.admin-nav li a { display: flex; align-items: center; gap: 12px; padding: 14px 24px; color: #cbd5e1; text-decoration: none; }
.admin-nav li a:hover, .admin-nav li a.active { background: var(--sidebar-hover); color: white; }
.admin-main { flex: 1; background: var(--bg-color); }
.admin-header { padding: 20px 32px; background: white; box-shadow: var(--shadow-sm); }
.admin-content { padding: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.btn { padding: 12px 24px; border-radius: var(--radius-md); font-weight: 500; cursor: pointer; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-secondary { background: var(--bg-color); color: var(--text-primary); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { background: var(--bg-color); }
.alert { padding: 16px; border-radius: var(--radius-md); margin-bottom: 20px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Toggle switch */
.toggle-btn {
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 24px;
    padding: 2px;
    background: #cbd5e1;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-btn.active { background: var(--success-color); }
.toggle-btn .toggle-slider {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.toggle-btn.active .toggle-slider { transform: translateX(20px); }
