/* Data Completeness Styles - Updated with mirrored vertical bar chart layout */

/* Main container styles */
#completeness-container {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Horizontal bars container */
.horizontal-bars-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
    margin-top: 30px;
    overflow-x: auto;
}

/* Company bar container */
.company-bar-container {
    position: relative;
    width: 36px; /* 30% of original 120px width */
    height: 450px; /* Increased height to leave more space */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(245, 245, 245, 0.5);
}

.company-bar-container:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Company name */
.company-name {
    font-size: 8px;
    font-weight: normal; /* Unbold */
    text-align: center;
    margin-bottom: 2px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Completion percentage */
.completion-percentage {
    font-size: 8px;
    font-weight: normal; /* Unbold */
    text-align: center;
    margin-top: 0;
    margin-bottom: 5px;
    color: #666;
}

/* Bars container */
.bars-container {
    position: relative;
    width: 24px; /* 30% of original 80px width */
    height: 350px; /* Increased height to leave more space */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 10px; /* Add space between company name/percentage and bars */
    margin-bottom: 20px; /* Add space at the bottom */
}

/* Midline */
.midline {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #ccc;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Above-line bar */
.above-line-bar {
    position: absolute;
    width: 24px; /* 30% of original 80px width */
    bottom: 50%;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    z-index: 2;
    transition: height 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80%; /* Limit height to leave space at top */
}

/* Above-line percentage */
.above-line-percentage {
    color: white;
    font-size: 7px;
    font-weight: normal; /* Unbold */
    text-align: center;
}

/* Below-line bar */
.below-line-bar {
    position: absolute;
    width: 24px; /* 30% of original 80px width */
    top: 50%;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    z-index: 2;
    transition: height 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80%; /* Limit height to leave space at bottom */
}

/* Below-line percentage */
.below-line-percentage {
    color: white;
    font-size: 7px;
    font-weight: normal; /* Unbold */
    text-align: center;
}

/* Legend container */
.legend-container {
    margin-top: 40px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Legend title */
.legend-title {
    font-size: 16px;
    font-weight: normal; /* Unbold */
    margin-bottom: 10px;
    text-align: left; /* Left align */
}

/* Legend section */
.legend-section {
    margin-bottom: 15px;
}

/* Legend section title */
.legend-section-title {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 5px;
}

/* Legend item */
.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

/* Legend color */
.legend-color {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    border-radius: 50%;
}

/* Legend text */
.legend-text {
    font-size: 14px;
}

/* Popover styles */
#data-completeness-popover {
    max-width: 300px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1000;
    font-size: 0.8em; /* Reduced text size */
}

.popover-title {
    font-weight: bold;
    font-size: 1em; /* Reduced from 1.1em */
    margin-bottom: 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

/* Hide debug message */
#completeness-container > p {
    display: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .horizontal-bars-container {
        gap: 3px;
    }
    
    .company-bar-container {
        width: 30px;
        height: 400px;
    }
    
    .bars-container {
        width: 21px;
        height: 300px;
    }
    
    .above-line-bar, .below-line-bar {
        width: 21px;
    }
    
    .company-name, .completion-percentage {
        font-size: 7px;
    }
    
    .above-line-percentage, .below-line-percentage {
        font-size: 6px;
    }
}

@media (max-width: 480px) {
    .horizontal-bars-container {
        gap: 2px;
    }
    
    .company-bar-container {
        width: 24px;
        height: 350px;
        padding: 3px;
    }
    
    .bars-container {
        width: 18px;
        height: 250px;
    }
    
    .above-line-bar, .below-line-bar {
        width: 18px;
    }
    
    .company-name, .completion-percentage {
        font-size: 6px;
    }
    
    .above-line-percentage, .below-line-percentage {
        font-size: 5px;
    }
}
