/* Tooltip Styles for PCB Configuration */

.tooltip-trigger {
    color: #8B0000;
    margin-left: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    opacity: 1;
    display: inline-block !important;
    vertical-align: middle;
    background: rgba(139, 0, 0, 0.15);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    position: relative;
    border: 2px solid rgba(139, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.2);
}

.tooltip-trigger:hover {
    opacity: 1;
    color: #A52A2A;
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(139, 0, 0, 0.3);
}

/* Tooltip Container - Hidden by default */
.gba-tooltip-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    backdrop-filter: blur(3px);
    animation: tooltipFadeIn 0.3s ease-out;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Tooltip Content */
.tooltip-content {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    max-width: 500px !important;
    width: 90% !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    animation: tooltipSlideIn 0.3s ease-out;
    position: relative !important;
    pointer-events: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Tooltip Header */
.tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.tooltip-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tooltip-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tooltip-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Tooltip Body */
.tooltip-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
    background: white;
    color: #2c3e50;
}

.tooltip-text {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tooltip-text p {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.tooltip-text p:last-child {
    margin-bottom: 0;
}

.tooltip-text p {
    margin: 0 0 15px 0;
}

.tooltip-text p:last-child {
    margin-bottom: 0;
}

.tooltip-text h1, .tooltip-text h2, .tooltip-text h3, .tooltip-text h4, .tooltip-text h5, .tooltip-text h6 {
    color: #8B0000;
    margin: 20px 0 10px 0;
}

.tooltip-text ul, .tooltip-text ol {
    margin: 15px 0;
    padding-left: 20px;
}

.tooltip-text li {
    margin-bottom: 8px;
}

.tooltip-text strong {
    color: #8B0000;
    font-weight: 600;
}

.tooltip-text em {
    font-style: italic;
    color: #7f8c8d;
}

/* Tooltip Image */
.tooltip-image {
    margin-top: 20px;
    text-align: center;
}

.tooltip-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .tooltip-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .tooltip-header {
        padding: 15px 20px 10px;
    }
    
    .tooltip-title {
        font-size: 16px;
    }
    
    .tooltip-body {
        padding: 20px;
    }
    
    .tooltip-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tooltip-content {
        width: 98%;
        max-height: 90vh;
    }
    
    .tooltip-header {
        padding: 12px 15px 8px;
    }
    
    .tooltip-title {
        font-size: 15px;
    }
    
    .tooltip-body {
        padding: 15px;
    }
    
    .tooltip-text {
        font-size: 12px;
    }
}

/* Tooltip trigger positioning */
.config-label .tooltip-trigger,
.spec-label .tooltip-trigger {
    display: inline-block !important;
    vertical-align: middle;
    margin-left: 8px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

/* Make tooltip triggers more visible */
.tooltip-trigger {
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(139, 0, 0, 0.3);
}

/* Ensure config-label displays tooltip trigger properly */
.config-label,
.spec-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
}

.config-label span.required,
.spec-label span.required {
    margin-right: 4px;
    color: #e74c3c;
    font-weight: bold;
}

/* Ensure tooltip triggers are always visible */
.tooltip-trigger {
    min-width: 24px;
    min-height: 24px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Make tooltip triggers stand out more */
.tooltip-trigger::before {
    content: '?';
    font-weight: bold;
    color: #8B0000;
}

/* Hover effect for tooltip triggers */
.tooltip-trigger {
    position: relative;
}

.tooltip-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.tooltip-trigger:hover::after {
    width: 30px;
    height: 30px;
}

/* Animation for tooltip appearance */
.gba-tooltip-container.show {
    animation: tooltipFadeIn 0.3s ease-out;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gba-tooltip-container.hide {
    animation: tooltipFadeOut 0.3s ease-in;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide tooltip container by default */
.gba-tooltip-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure tooltip container is hidden when not needed */
.gba-tooltip-container:not(.show) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure tooltip is visible when shown */
.gba-tooltip-container.show .tooltip-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gba-tooltip-container.show .tooltip-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gba-tooltip-container.show .tooltip-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes tooltipFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Custom scrollbar for tooltip content */
.tooltip-body::-webkit-scrollbar {
    width: 6px;
}

.tooltip-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 3px;
}

.tooltip-body::-webkit-scrollbar-thumb:hover {
    background: #A52A2A;
}

/* Simple Tooltip Styles */
.gba-simple-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 400px;
    z-index: 10000;
    font-size: 14px;
    line-height: 1.4;
    animation: simpleTooltipFadeIn 0.3s ease-out;
}

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

.simple-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px 8px;
    background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.simple-tooltip-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.simple-tooltip-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.simple-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.simple-tooltip-content {
    padding: 15px;
    color: #2c3e50;
    max-height: 300px;
    overflow-y: auto;
}

.simple-tooltip-content p {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.simple-tooltip-content p:last-child {
    margin-bottom: 0;
} 