/* CCT Labs Hover Text & Drawer Styles */

/* ========== Concept Highlighting ========== */
.concept {
    border-bottom: 1px dotted rgba(52, 152, 219, 0.65);
    cursor: help;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.concept:hover,
.concept:focus {
    border-bottom-color: rgba(52, 152, 219, 1);
    border-bottom-width: 2px;
}

/* No-concept marker (excluded from highlighting) */
.no-concept {
    border-bottom: none !important;
    cursor: inherit;
}

/* ========== Tooltip ========== */
.cct-tooltip {
    position: absolute;
    background-color: var(--cct-primary, #2c3e50);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    max-width: 320px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    line-height: 1.5;
}

.cct-tooltip.show {
    opacity: 1;
}

/* ========== Drawer Link ========== */
.drawer-link {
    background: none;
    border: none;
    color: var(--cct-secondary, #3498db);
    text-decoration: underline;
    text-decoration-color: rgba(52, 152, 219, 0.4);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font: inherit;
}

.drawer-link:hover,
.drawer-link:focus {
    color: var(--cct-primary, #2c3e50);
    text-decoration-color: var(--cct-secondary, #3498db);
    text-decoration-thickness: 2px;
    outline: none;
}

/* ========== Drawer Overlay ========== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========== Drawer Panel ========== */
.drawer-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: var(--cct-bg, white);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-panel.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--cct-border, #dee2e6);
    background: var(--cct-sidebar-bg, #f8f9fa);
    flex-shrink: 0;
}

.drawer-title {
    margin: 0;
    color: var(--cct-primary, #2c3e50);
    font-size: 1.2rem;
    font-weight: 600;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    border-radius: 50%;
}

.drawer-close:hover {
    color: var(--cct-accent, #e74c3c);
    transform: scale(1.1);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.7;
}

.drawer-content p {
    margin-bottom: 1em;
}

.drawer-content h1,
.drawer-content h2,
.drawer-content h3,
.drawer-content h4 {
    color: var(--cct-primary, #2c3e50);
    margin-top: 0;
    margin-bottom: 0.5em;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ========== Mobile Responsiveness ========== */
@media (max-width: 600px) {
    .drawer-panel {
        width: 100%;
        max-width: 100%;
    }

    .cct-tooltip {
        max-width: 280px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .drawer-header {
        padding: 15px;
    }

    .drawer-content {
        padding: 15px;
    }
}

/* ========== Dark Mode Adjustments ========== */
[data-theme="dark"] .cct-tooltip,
html.dark .cct-tooltip {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

[data-theme="dark"] .drawer-panel,
html.dark .drawer-panel {
    background: var(--cct-bg, #1a1a1a);
}

[data-theme="dark"] .drawer-header,
html.dark .drawer-header {
    background: var(--cct-sidebar-bg, #2d2d2d);
    border-color: var(--cct-border, #444);
}

[data-theme="dark"] .drawer-close,
html.dark .drawer-close {
    color: #999;
}

[data-theme="dark"] .drawer-close:hover,
html.dark .drawer-close:hover {
    color: var(--cct-accent, #e74c3c);
}