/* Mobile Bottom Overlay for Tooltips */

/* Mobile overlay container */
.mobile-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    border-top: 1px solid #30363d;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.mobile-overlay.show {
    transform: translateY(0);
}

/* Overlay header with just drag handle */
.mobile-overlay-header {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #30363d;
    background: #000000;
    border-radius: 16px 16px 0 0;
}

/* Drag handle for swipe-to-close - more subtle */
.mobile-overlay-handle {
    width: 32px;
    height: 2px;
    background: #484f58;
    border-radius: 1px;
    margin: 0 auto 4px auto;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    cursor: grab;
    opacity: 0.6;
}

.mobile-overlay-handle:active {
    background: #6e7681;
    opacity: 0.8;
    cursor: grabbing;
}

/* Overlay content area */
.mobile-overlay-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    color: #f0f6fc;
    font-size: 14px;
    line-height: 1.6;
}

/* Content styling similar to tooltip */
.mobile-overlay-content h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f0f6fc;
    font-weight: 600;
}

.mobile-overlay-content .tooltip-name {
    flex: 1;
    margin-right: 8px;
}

.mobile-overlay-content .alias-level-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #000000;
    color: #f0f6fc;
    display: inline-block;
    border: 1px solid #30363d;
    flex-shrink: 0;
}

.mobile-overlay-content .alias-level-tag.core {
    background-color: #1f6feb;
    color: #ffffff;
    border-color: #1f6feb;
}

.mobile-overlay-content p {
    margin: 8px 0;
    color: #c9d1d9;
}

.mobile-overlay-content strong {
    color: #f0f6fc;
    font-weight: 600;
}

/* Color swatch styling */
.mobile-overlay-content .tooltip-color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #30363d;
    margin-left: 6px;
    margin-right: 4px;
    vertical-align: middle;
    border-radius: 4px;
}

/* Mode list styling */
.mobile-overlay-content .tooltip-modes-list {
    padding-left: 0;
    list-style: none;
    margin: 8px 0;
}

.mobile-overlay-content .tooltip-modes-list li {
    padding: 6px 12px;
    background: #000000;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin: 4px 0;
}

/* Backdrop for mobile overlay - disabled/hidden */
.mobile-overlay-backdrop {
    display: none;
}

/* Hide regular tooltip on mobile */
@media (max-width: 768px) {
    .tooltip {
        display: none !important;
    }
}

/* Animation for smooth appearance */
@keyframes mobileOverlaySlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-overlay.animate-in {
    animation: mobileOverlaySlideUp 0.3s ease-out;
}

/* Responsive adjustments for very small screens */
@media (max-width: 375px) {
    .mobile-overlay-content {
        padding: 12px;
        font-size: 13px;
    }
    
    .mobile-overlay-content h4 {
        font-size: 15px;
    }
}

/* Ensure overlay content doesn't interfere with other elements */
.mobile-overlay-content * {
    user-select: text;
    -webkit-user-select: text;
}

/* Mobile overlay actions section */
.mobile-overlay-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Show in tree button - similar to variable-target-icon */
.mobile-show-in-tree {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-height: 40px; /* Touch-friendly height */
    font-family: inherit;
}

.mobile-show-in-tree:hover {
    color: #4ecdc4;
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.mobile-show-in-tree:active {
    color: #3db8ad;
    border-color: #3db8ad;
    background: rgba(78, 205, 196, 0.15);
    transform: scale(0.98);
}

.show-in-tree-icon {
    font-size: 16px;
    line-height: 1;
}

.show-in-tree-text {
    font-weight: 500;
}

/* Show full path button - similar styling with different color accent */
.mobile-show-full-path {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-height: 40px; /* Touch-friendly height */
    font-family: inherit;
}

.mobile-show-full-path:hover {
    color: #a78bfa; /* Purple accent for path functionality */
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.mobile-show-full-path:active {
    color: #8b5cf6;
    border-color: #8b5cf6;
    background: rgba(167, 139, 250, 0.15);
    transform: scale(0.98);
}

.show-full-path-icon {
    font-size: 16px;
    line-height: 1;
}

.show-full-path-text {
    font-weight: 500;
}

/* Mobile Connection Impact Styles */
.impact-oneliner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Risk level colors for mobile */
.impact-oneliner.risk-high {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.impact-oneliner.risk-medium {
    background: rgba(255, 204, 0, 0.15);
    border-color: rgba(255, 204, 0, 0.3);
    color: #ffcc00;
}

.impact-oneliner.risk-low {
    background: rgba(52, 199, 89, 0.15);
    border-color: rgba(52, 199, 89, 0.3);
    color: #34c759;
}
