/* 
 * FN Capital Comparison Tool - Styles
 * Shared styles for both versions of the comparison tool
 */

/* Reset and base styles */
.fn-capital-comparison-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.fn-capital-comparison-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Layout structure - Two-column layout */
.fn-capital-comparison-container .page-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

.fn-capital-comparison-container .questions-column {
    width: 100%;
}

.fn-capital-comparison-container .results-column {
    width: 100%;
}

@media (min-width: 992px) {
    .fn-capital-comparison-container .page-container {
        flex-direction: row;
    }
    
    .fn-capital-comparison-container .questions-column {
        flex: 0 0 60%;
    }
    
    .fn-capital-comparison-container .results-column {
        flex: 0 0 40%;
        position: sticky;
        top: 20px;
        align-self: flex-start;
        /* max-height: calc(100vh - 40px); */
        overflow-y: auto;
    }
}

/* Container styles */
.fn-capital-comparison-title {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 28px;
    display: none;
}

.fn-capital-comparison-form {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fn-capital-comparison-question {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.fn-capital-comparison-question:last-child {
    border-bottom: none;
}

.fn-capital-comparison-question-text {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* Question number format */
.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Color each question number based on index */
#question-number-1 { background-color: #0d47a1; }
#question-number-2 { background-color: #1565c0; }
#question-number-3 { background-color: #1976d2; }
#question-number-4 { background-color: #1e88e5; }
#question-number-5 { background-color: #2196f3; }
#question-number-6 { background-color: #42a5f5; }
#question-number-7 { background-color: #64b5f6; }
#question-number-8 { background-color: #90caf9; }
#question-number-9 { background-color: #bbdefb; }
#question-number-10 { background-color: #e3f2fd; }

/* Tooltip styles */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #000;
    color: white;
    font-size: 12px;
    margin-left: 8px;
    cursor: pointer;
}

.tooltip-container {
    position: absolute;
    background-color: #000;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-container.visible {
    opacity: 1;
    visibility: visible;
}

.tooltip-container::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #000 transparent transparent;
}

/* Form elements */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    padding: 10px;
    background-color: #f1f5f9;
    text-align: center;
    font-weight: 600;
}

.comparison-table td {
    padding: 7px 10px;
    vertical-align: middle;
    width: 50%;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* User investment and Fast AI divs */
.user-investment-div {
    background-color: #f1f5f9;
    padding: 10px;
    border-radius: 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.fast-ai-div {
    background-color: #e3f2fd;
    padding: 0 10px;
    border-radius: 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
    text-align: center;
    align-content: center;
    justify-content: center;
}

/* Winner styles */
.winner-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #4caf50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(15deg);
    z-index: 1;
    display: none;
}

.winner-cell {
    background-color: rgba(76, 175, 80, 0.2);
}

/* Results section */
.results-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-title {
    text-align: center;
    margin-bottom: 0px;
    color: #2c3e50;
    font-size: 22px;
}

.score-display {
    text-align: center;
    margin-bottom: 20px;
}

.score-number {
    font-size: 52px;
    font-weight: bold;
    color: #2196f3;
}

.score-text {
    font-size: 16px;
    color: #666;
}

.recommendation {
    background-color: #f1f5f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.5;
}

.score-fraction {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.score-fraction div {
    font-size: 18px;
    font-weight: bold;
}

#current-score {
    color: #2196f3;
}

#fast-ai-score {
    color: #2196f3;
}

/* Bar chart styles - FIXED */
.side-by-side-chart {
    display: flex;
    margin-bottom: 20px;
    /* height: 300px; */
    position: relative; /* Added position relative */
    z-index: 1; /* Ensure proper stacking context */
}

.bar-chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    position: relative; /* Added position relative */
}

.bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    position: relative; /* Added position relative */
    overflow: visible;
}

/* Fixed bar segment styles */
.bar-segment {
    width: 100%;
    position: relative;
    display: block; /* Changed from flex to block */
    color: white;
    font-weight: bold;
    overflow: visible;
    padding: 10px 0; /* Added padding for better spacing */
    min-height: 40px; /* Minimum height to ensure visibility */
    margin-bottom: 1px; /* Increased margin for better separation */
}

/* Fixed segment number styles */
.segment-number {
    position: absolute; /* Changed to absolute positioning */
    left: 5px; /* Position on the left side */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Center vertically */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px; /* Increased size */
    height: 24px; /* Increased size */
    border-radius: 50%;
    background-color: white;
    color: #333;
    font-size: 12px;
    z-index: 5; /* Ensure it's above other elements */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Added shadow for better visibility */
}

/* Fixed segment title styles */
.segment-title {
    position: absolute; /* Changed to absolute positioning */
    left: 35px; /* Position after the number */
    right: 35px; /* Leave space for tooltip icon */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Center vertically */
    font-size: 12px;
    color: white; /* Ensure text is white */
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); /* Added text shadow for better readability */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center; /* Center the text */
    z-index: 3; /* Ensure proper stacking */
}

/* Fixed segment tooltip icon styles */
.segment-tooltip-icon {
    position: absolute; /* Changed to absolute positioning */
    right: 5px; /* Position on the right side */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Center vertically */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.8);
    color: #333;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    z-index: 5; /* Ensure it's above other elements */
}

/* Hide tooltip content divs */
.segment-tooltip {
    display: none;
}

/* Animation for bar segments */
.animate-segment {
    animation: growSegment 0.5s ease-out forwards;
}

@keyframes growSegment {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.bar-label {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

/* Empty bar message */
.empty-bar-message {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Chart legend */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center; /* Center the legend items */
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 10px;
    margin-bottom: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 2px;
}

.legend-text {
    font-size: 12px;
}

/* Detailed results table */
.detailed-results {
    margin-top: 20px;
}

.detailed-results-title {
    margin-bottom: 10px;
    font-size: 18px;
    color: #2c3e50;
}

.detailed-results-table {
    width: 100%;
    border-collapse: collapse;
}

.detailed-results-table th,
.detailed-results-table td {
    padding: 0 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.detailed-results-table th {
    background-color: #f1f5f9;
    font-weight: 600;
}

.detailed-results-table .fast-ai-winner {
    color: #4caf50;
    font-weight: bold;
}

.detailed-results-table .current-winner {
    color: #2196f3;
    font-weight: bold;
}

.detailed-results-table .tie-winner {
    color: #757575;
    font-weight: bold;
}

/* Email collection form */
.email-collection-form {
    background-color: #f1f5f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.email-collection-form p {
    margin-bottom: 10px;
}

.email-collection-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.submit-button {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.submit-button:hover {
    background-color: #1976d2;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .bar-segment {
        min-height: 30px;
    }
    
    .segment-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
        left: 2px;
    }
    
    .segment-title {
        left: 25px;
        right: 25px;
        font-size: 10px;
    }
    
    .segment-tooltip-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
        right: 2px;
    }
}

/* Fix for WordPress theme conflicts */
.fn-capital-comparison-container .bar-segment * {
    box-sizing: border-box !important;
}

.fn-capital-comparison-container .segment-number,
.fn-capital-comparison-container .segment-title,
.fn-capital-comparison-container .segment-tooltip-icon {
    position: absolute !important;
}

/* Fix for z-index issues with some themes */
.fn-capital-comparison-container {
    position: relative;
    z-index: 1;
}

/* Ensure tooltips appear above everything */
#tooltip-container {
    z-index: 9999 !important;
}

/* Fix for circle styling */
.segment-number .circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
