/* Node Tooltip Styles */

.node-tooltip {
    position: fixed;
    background: #ffffff;
    border-width: 1px;
    border-style: solid;
    /* Border gradient: lighter at top (#d9d9d9), barely visible at bottom (#f5f5f5) - matches modules/folders/tasks */
    border-image: linear-gradient(to bottom,
        #d9d9d9 0%,     /* 20% lighter than #ccc at top */
        #e6e6e6 30%,    /* Transition */
        #f0f0f0 70%,    /* Transition */
        #f5f5f5 100%    /* Barely visible at bottom */
    ) 1;
    border-radius: 16px; /* All corners 16px (double radius, same as modules) */
    box-shadow: 0 1.5px 6px rgba(0, 0, 0, 0.08); /* Lighter shadow matching modules */
    padding: 0;
    z-index: 10001; /* Higher than help tooltip (10000) to appear on top */
    max-width: 450px;
    min-width: 280px;
    font-family: sans-serif;
    font-size: 14px;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-tooltip.hidden {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); /* Even lighter during hide animation */
    pointer-events: none;
    /* display: none handled in JS to allow transitions */
}

.node-tooltip.hiding {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); /* Even lighter during hide animation */
    pointer-events: none;
}

/* Tooltip Name Header (with expand button) */
.tooltip-name-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-type-icon {
    font-size: 16px;
    color: #666;
    flex-shrink: 0;
    width: 20px; /* Match focus button width for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip Content */
.tooltip-content {
    padding: 12px;
    /* Subtle background gradient - fades to slightly lighter at bottom (matches module content) */
    background: linear-gradient(to bottom,
        rgba(204, 204, 204, 0.08) 0%,    /* Very subtle tint at top */
        rgba(255, 255, 255, 0) 100%      /* Fade to transparent/white at bottom */
    );
}

.tooltip-name {
    font-size: 13px;
    font-weight: 600;
    color: #252422;
    word-wrap: break-word;
    line-height: 1.3;
    flex: 1;
    padding-top: 1px;
    cursor: pointer;
    user-select: none;
}

.tooltip-name:hover {
    color: #333;
}

.tooltip-expand {
    background: none;
    border: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0;
}

.tooltip-expand:hover {
    color: #333;
}

.tooltip-expand:active {
    transform: scale(0.85);
}

.tooltip-expand.hidden {
    display: none;
}

.tooltip-expand:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.expand-icon {
    font-size: 16px;
    display: inline-block;
    transition: opacity 0.2s ease, transform 0.2s ease;
    vertical-align: middle;
}

/* Tooltip Details (Always Expanded) */
.tooltip-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Footer items container - inline layout */
.tooltip-footer {
    display: flex;
    align-items: center;
    gap: 6px; /* Match header gap */
    flex-wrap: wrap;
}

/* Description Toggle - appears at top when expanded */
.tooltip-description {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0) scaleY(1);
    transform-origin: top;
    padding-bottom: 8px;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s,
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                padding-bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tooltip-description.hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px) scaleY(0.8);
    padding-bottom: 0;
    transition: max-height 0.35s cubic-bezier(0.55, 0.085, 0.68, 0.53),
                opacity 0.25s cubic-bezier(0.55, 0.085, 0.68, 0.53),
                transform 0.35s cubic-bezier(0.55, 0.085, 0.68, 0.53),
                padding-bottom 0.35s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

/* Focus button - inline with other footer items */
.tooltip-focus-button {
    background: none;
    border: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    line-height: 1;
}

.tooltip-status {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.tooltip-focus-button:hover {
    color: #333;
}

.tooltip-focus-button:active {
    transform: scale(0.85);
}

.focus-icon {
    font-size: 16px;
    display: inline-block;
    transition: opacity 0.2s ease;
    vertical-align: middle;
}

/* Task counts in tooltip */
.tooltip-task-counts {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.tooltip-task-label {
    font-weight: 600;
    color: #555;
    margin-right: 4px;
}

.tooltip-count-badge {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tooltip-count-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding-top: 1px; /* Optical centering - 5% of ~18px */
    line-height: 1;
}

.tooltip-count-badge.status-new .tooltip-count-circle {
    background-color: #ffffff;
    color: #252422;
}

.tooltip-count-badge.status-open .tooltip-count-circle {
    background-color: #3498db;
    color: #ffffff;
}

.tooltip-count-badge.status-closed .tooltip-count-circle {
    background-color: #95a5a6;
    color: #ffffff;
}

/* Animations - handled via CSS transitions */
