/* Smart Help System Styles */
.smart-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.smart-help-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.smart-help-modal {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.smart-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f0f);
}

.smart-help-header h2 {
    margin: 0;
    color: var(--accent-color, #00cc66);
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.smart-help-close-btn {
    background: transparent;
    border: 1px solid var(--border-color, #444);
    color: var(--text-secondary, #888);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-help-close-btn:hover {
    background: var(--bg-tertiary, #333);
    color: var(--text-primary, #fff);
    border-color: var(--border-hover, #666);
}

.smart-help-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Navigation Sidebar */
.smart-help-nav {
    width: 260px;
    background: var(--bg-primary, #0f0f0f);
    border-right: 1px solid var(--border-color, #333);
    overflow-y: auto;
    flex-shrink: 0;
}

.help-nav-section {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color, #333);
}

.help-nav-section:last-child {
    border-bottom: none;
}

.help-nav-title {
    color: var(--text-secondary, #888);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px 10px;
    margin: 0;
}

.help-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-primary, #e0e0e0);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.help-nav-item:hover {
    background: var(--bg-secondary, #1a1a1a);
    color: var(--accent-color, #00cc66);
}

.help-nav-item.active {
    background: rgba(0, 204, 102, 0.1);
    border-left-color: var(--accent-color, #00cc66);
    color: var(--accent-color, #00cc66);
}

.help-nav-item i {
    width: 18px;
    color: var(--text-secondary, #888);
    font-size: 12px;
}

.help-nav-item:hover i,
.help-nav-item.active i {
    color: var(--accent-color, #00cc66);
}

/* Content Area */
.smart-help-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

.help-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.help-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-section-title {
    color: var(--accent-color, #00cc66);
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color, #333);
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-section-title i {
    font-size: 20px;
}

.help-text {
    color: var(--text-primary, #e0e0e0);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 14px;
}

.help-text strong {
    color: var(--accent-color, #00cc66);
}

/* Live Demo Containers */
.help-demo-container {
    background: var(--bg-primary, #0f0f0f);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.help-demo-header {
    background: var(--bg-tertiary, #252525);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color, #333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-demo-header span {
    color: var(--text-secondary, #888);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-demo-badge {
    background: var(--accent-color, #00cc66);
    color: #000;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.help-demo-content {
    padding: 20px;
}

/* Annotation Callouts */
.help-annotation {
    display: flex;
    gap: 15px;
    background: rgba(0, 204, 102, 0.08);
    border: 1px solid rgba(0, 204, 102, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.help-annotation-number {
    width: 24px;
    height: 24px;
    background: var(--accent-color, #00cc66);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.help-annotation-text {
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    line-height: 1.6;
}

.help-annotation-text strong {
    color: var(--accent-color, #00cc66);
}

/* Info Boxes */
.help-info-box {
    display: flex;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.help-info-box.tip {
    background: rgba(0, 204, 102, 0.1);
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.help-info-box.warning {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.help-info-box.danger {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.help-info-box.info {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.help-info-box i {
    font-size: 16px;
    margin-top: 2px;
}

.help-info-box.tip i { color: #00cc66; }
.help-info-box.warning i { color: #ffcc00; }
.help-info-box.danger i { color: #ff4444; }
.help-info-box.info i { color: #4a9eff; }

.help-info-box-content {
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    line-height: 1.6;
}

/* Status Legend */
.help-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.help-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
}

.help-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.help-status-dot.green { background: #00cc66; box-shadow: 0 0 8px rgba(0, 204, 102, 0.5); }
.help-status-dot.yellow { background: #ffcc00; box-shadow: 0 0 8px rgba(255, 204, 0, 0.5); }
.help-status-dot.red { background: #ff4444; box-shadow: 0 0 8px rgba(255, 68, 68, 0.5); }
.help-status-dot.gray { background: #666; }
.help-status-dot.blue { background: #4a9eff; box-shadow: 0 0 8px rgba(74, 158, 255, 0.5); }

.help-status-info strong {
    display: block;
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    margin-bottom: 2px;
}

.help-status-info span {
    color: var(--text-secondary, #888);
    font-size: 11px;
}

/* Feature Cards */
.help-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.help-feature-card {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s;
}

.help-feature-card:hover {
    border-color: var(--accent-color, #00cc66);
    transform: translateY(-2px);
}

.help-feature-card h4 {
    color: var(--accent-color, #00cc66);
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-feature-card p {
    color: var(--text-secondary, #888);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* Tables */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 13px;
}

.help-table th,
.help-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #333);
}

.help-table th {
    background: var(--bg-tertiary, #252525);
    color: var(--accent-color, #00cc66);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-table td {
    color: var(--text-primary, #e0e0e0);
}

.help-table tr:hover td {
    background: var(--bg-secondary, #1a1a1a);
}

.help-table code {
    background: var(--bg-tertiary, #252525);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: var(--accent-color, #00cc66);
}

/* Role Badges */
.help-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.help-role-badge.admin {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.4);
}

.help-role-badge.operator {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
    border: 1px solid rgba(0, 204, 102, 0.4);
}

.help-role-badge.viewer {
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.4);
}

/* Keyboard Shortcuts */
.help-shortcut {
    display: inline-block;
    background: var(--bg-tertiary, #252525);
    border: 1px solid var(--border-color, #444);
    border-radius: 4px;
    padding: 3px 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    color: var(--text-primary, #e0e0e0);
    margin: 0 2px;
}

/* Live Data Indicators */
.help-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--accent-color, #00cc66);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-live-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-color, #00cc66);
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Workflow Steps */
.help-workflow {
    margin: 20px 0;
}

.help-workflow-step {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
}

.help-workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: -10px;
    width: 2px;
    background: var(--border-color, #333);
}

.help-step-number {
    width: 36px;
    height: 36px;
    background: var(--accent-color, #00cc66);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    z-index: 1;
}

.help-step-content {
    flex: 1;
    padding-top: 6px;
}

.help-step-content h4 {
    color: var(--text-primary, #e0e0e0);
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 5px 0;
}

.help-step-content p {
    color: var(--text-secondary, #888);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* Live Preview Elements - Clone actual UI styles */
.help-preview-sidebar {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    max-width: 300px;
    overflow: hidden;
}

.help-preview-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color, #333);
    cursor: pointer;
    transition: background 0.2s;
}

.help-preview-node:hover {
    background: var(--bg-tertiary, #252525);
}

.help-preview-node:last-child {
    border-bottom: none;
}

.help-preview-node.selected {
    background: rgba(0, 204, 102, 0.15);
    border-left: 3px solid var(--accent-color, #00cc66);
}

/* Responsive */
@media (max-width: 900px) {
    .smart-help-body {
        flex-direction: column;
    }

    .smart-help-nav {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #333);
    }

    .smart-help-content {
        padding: 20px;
    }

    .help-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Info Modal (Version) */
.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.info-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.info-modal {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.info-modal-logo {
    margin-bottom: 15px;
}

.info-modal-logo img {
    height: 28px !important;
}

.info-modal h3 {
    color: var(--text-secondary, #888);
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 12px 0;
}

.info-modal-version {
    color: var(--text-secondary, #888);
    font-size: 13px;
    margin-bottom: 4px;
}

.info-modal-commit {
    color: var(--text-secondary, #888);
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
    margin-bottom: 12px;
}

.info-modal-copyright {
    color: var(--text-secondary, #888);
    font-size: 11px;
    white-space: nowrap;
}

.info-modal-close {
    margin-top: 20px;
    background: var(--bg-tertiary, #252525);
    border: 1px solid var(--border-color, #444);
    color: var(--text-primary, #e0e0e0);
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.info-modal-close:hover {
    background: var(--accent-color, #00cc66);
    color: #000;
    border-color: var(--accent-color, #00cc66);
}

/* ==================== LOGOUT CONFIRMATION MODAL ==================== */

.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.logout-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.logout-modal {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.logout-modal-icon {
    margin-bottom: 15px;
}

.logout-modal-icon i {
    font-size: 48px;
    color: #ff6b6b;
}

.logout-modal h3 {
    color: var(--text-primary, #e0e0e0);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.logout-modal p {
    color: var(--text-secondary, #888);
    font-size: 14px;
    margin-bottom: 20px;
}

.logout-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-modal-btn {
    padding: 10px 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
}

.logout-modal-btn.cancel {
    background: var(--bg-tertiary, #252525);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #e0e0e0);
}

.logout-modal-btn.cancel:hover {
    background: var(--bg-quaternary, #2a2a2a);
    border-color: #555;
}

.logout-modal-btn.confirm {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

.logout-modal-btn.confirm:hover {
    background: #ff6666;
    border-color: #ff6666;
}

/* ==================== LIGHT MODE SUPPORT ==================== */

body.light-mode .smart-help-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .smart-help-modal {
    background: #ffffff;
    border-color: #ddd;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .smart-help-header {
    background: #f5f5f5;
    border-bottom-color: #ddd;
}

body.light-mode .smart-help-header h2 {
    color: #009955;
}

body.light-mode .smart-help-close-btn {
    border-color: #ccc;
    color: #666;
}

body.light-mode .smart-help-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    border-color: #999;
}

body.light-mode .smart-help-nav {
    background: #f5f5f5;
    border-right-color: #ddd;
}

body.light-mode .help-nav-title {
    color: #666;
}

body.light-mode .help-nav-item {
    color: #333;
}

body.light-mode .help-nav-item:hover {
    background: #e8e8e8;
    color: #009955;
}

body.light-mode .help-nav-item.active {
    background: rgba(0, 153, 85, 0.1);
    border-left-color: #009955;
    color: #009955;
}

body.light-mode .help-nav-item i {
    color: #666;
}

body.light-mode .help-nav-item:hover i,
body.light-mode .help-nav-item.active i {
    color: #009955;
}

body.light-mode .help-section-title {
    color: #009955;
    border-bottom-color: #ddd;
}

body.light-mode .help-text {
    color: #333;
}

body.light-mode .help-text strong {
    color: #009955;
}

body.light-mode .help-demo-container {
    background: #f9f9f9;
    border-color: #ddd;
}

body.light-mode .help-demo-header {
    background: #f0f0f0;
    border-bottom-color: #ddd;
}

body.light-mode .help-demo-header span {
    color: #666;
}

body.light-mode .help-annotation {
    background: rgba(0, 153, 85, 0.08);
    border-color: rgba(0, 153, 85, 0.25);
}

body.light-mode .help-annotation-text {
    color: #333;
}

body.light-mode .help-annotation-text strong {
    color: #009955;
}

body.light-mode .help-info-box-content {
    color: #333;
}

body.light-mode .help-status-item {
    background: #f5f5f5;
    border-color: #ddd;
}

body.light-mode .help-status-info strong {
    color: #333;
}

body.light-mode .help-status-info span {
    color: #666;
}

body.light-mode .help-feature-card {
    background: #f9f9f9;
    border-color: #ddd;
}

body.light-mode .help-feature-card:hover {
    border-color: #009955;
}

body.light-mode .help-feature-card h4 {
    color: #009955;
}

body.light-mode .help-feature-card p {
    color: #666;
}

body.light-mode .help-table th {
    background: #f0f0f0;
    color: #009955;
}

body.light-mode .help-table td {
    color: #333;
}

body.light-mode .help-table th,
body.light-mode .help-table td {
    border-bottom-color: #ddd;
}

body.light-mode .help-table tr:hover td {
    background: #f5f5f5;
}

body.light-mode .help-table code {
    background: #f0f0f0;
    color: #009955;
}

body.light-mode .help-shortcut {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

body.light-mode .help-step-content h4 {
    color: #333;
}

body.light-mode .help-step-content p {
    color: #666;
}

body.light-mode .help-workflow-step:not(:last-child)::after {
    background: #ddd;
}

body.light-mode .help-preview-sidebar {
    background: #f9f9f9;
    border-color: #ddd;
}

body.light-mode .help-preview-node {
    border-bottom-color: #ddd;
}

body.light-mode .help-preview-node:hover {
    background: #f0f0f0;
}

/* Info Modal Light Mode */
body.light-mode .info-modal-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .info-modal {
    background: #ffffff;
    border-color: #ddd;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .info-modal h3 {
    color: #666;
}

body.light-mode .info-modal-version {
    color: #666;
}

body.light-mode .info-modal-commit {
    color: #666;
}

body.light-mode .info-modal-copyright {
    color: #666;
}

body.light-mode .info-modal-close {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

body.light-mode .info-modal-close:hover {
    background: #009955;
    color: #fff;
    border-color: #009955;
}

body.light-mode .logout-modal-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .logout-modal {
    background: #ffffff;
    border-color: #ddd;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .logout-modal h3 {
    color: #333;
}

body.light-mode .logout-modal p {
    color: #666;
}

body.light-mode .logout-modal-btn.cancel {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

body.light-mode .logout-modal-btn.cancel:hover {
    background: #e0e0e0;
    border-color: #bbb;
}
