/**
 * Styles for the Lux Level Calculator
 * Extends global styles with tool-specific styling
 */

/* Tooltip styling */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-align: center;
    border-radius: 50%;
    background-color: var(--color-text, #333);
    color: var(--color-card-bg, white);
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 8px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 100; /* Add z-index to the icon itself */
}

.tooltip-icon::before {
    content: "?";
    display: inline-block;
}

.tooltip-icon:hover {
    transform: scale(1.1);
    background-color: var(--color-text-secondary, #666);
}

/* Base tooltip styling - fixed version */
.tooltip-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    min-width: 200px;
    max-width: 250px;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    background-color: var(--color-card-bg, white);
    color: var(--color-text, #333);
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 10000; /* Increased z-index to ensure it's above everything */
    pointer-events: none;
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.2));
    
    /* Position tooltip so right edge aligns perfectly with the tooltip icon */
    bottom: 25px;
    right: 0; /* Align right edge with icon */
    transform: none;
}

/* Remove special position for first tooltip - all tooltips should appear top-left */

/* Show tooltips on hover */
.tooltip-icon:hover[data-tooltip]::after {
    opacity: 1;
    visibility: visible;
}

/* Ensure dynamically created tooltips appear above everything */
.dynamic-tooltip {
    position: fixed;
    z-index: 10000 !important;
    pointer-events: none !important;
}

/* Mobile adjustments - using global adjustments from components.css */
@media (max-width: 768px) {
    .tooltip-icon[data-tooltip]::after {
        max-width: 200px;
        min-width: 150px;
        right: 0; /* Align right edge with icon */
        transform: none; /* Don't shift the tooltip */
    }
}

/* Add proper padding to result items for tooltip icons */
.result-group .result-item {
    position: relative;
    padding-right: 30px; /* Add extra padding on the right for the tooltip icon */
    z-index: 1; /* Create stacking context */
}

/* Position the tooltip icon properly within the result item */
.result-group .result-item .tooltip-icon {
    position: absolute;
    right: 8px; /* Position 8px from the right edge for more breathing room */
    z-index: 100; /* Keep icon above other content */
}

/* Make sure the tooltip doesn't overlap with content */
.result-group .result-item > span:nth-child(2) {
    margin-right: 25px; /* Keep some space between the value and tooltip */
}

/* Dark theme adjustments for tooltips */
html.dark-theme .tooltip-icon,
body.dark-theme .tooltip-icon {
    background-color: var(--color-text, #f5f5f5);
    color: var(--color-card-bg, #2c3e50);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html.dark-theme .tooltip-icon:hover,
body.dark-theme .tooltip-icon:hover {
    background-color: var(--color-text-secondary, #ecf0f1);
}

/* Dark theme tooltip appearance */
html.dark-theme .tooltip-icon[data-tooltip]::after,
body.dark-theme .tooltip-icon[data-tooltip]::after {
    background-color: var(--color-card-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

/* Compact result layout for Luxcalc: reduce unused space */
 /* Compact and auto-sized results in Luxcalc */
/* Override global full-height flex on output section for compact results */
.calculator .output-section .result-group {
    display: block !important;
    flex: none !important;
    height: auto !important;
    gap: var(--space-sm) !important;         /* smaller vertical spacing */
    padding: var(--space-sm) !important;     /* reduced container padding */
    margin-bottom: var(--space-md) !important;
}
/* Add vertical spacing between each result item */
.calculator .output-section .result-group .result-item {
    margin-bottom: var(--space-sm);
}
.calculator .output-section .result-group .result-item:last-child {
    margin-bottom: 0;
}
 .output-section .result-group .result-item {
    padding: var(--space-xs) var(--space-sm); /* tighter padding */
}

/* Output section styling - removing in favor of global styles
.unit {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-left: 4px;
}
*/

/* Removed for global styling compatibility:
/* /* Removed for global styling compatibility:
/* Removed for global styling compatibility:/* Removed for global styling compatibility:

/* Removed for global styling compatibility:
/* Removed for global styling compatibility:/* Removed for global styling compatibility:

.result-group {
    background: var(--background-light);
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}
*/
*/
*/
*/
*/
*/ */

/* Removed for global styling compatibility:
/* /* Removed for global styling compatibility:
/* Removed for global styling compatibility:/* Removed for global styling compatibility:

/* Removed for global styling compatibility:
/* Removed for global styling compatibility:/* Removed for global styling compatibility:

.result-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color-light);
}
*/
*/
*/
*/
*/
*/ */

.result-item:last-child {
    border-bottom: none;
}

.result-item span:first-child {
    min-width: 180px;
    font-weight: 500;
    flex: 1;
}

/* Adjust result value (second span) spacing */
.result-item > span:nth-child(2) {
    text-align: right;
    margin-right: 5px;
    font-weight: 600;
}

/* Position unit displays properly */
.result-item .unit {
    /* Minimal gap between number and unit */
    margin-left: 0;   /* remove extra gap from number */
    margin-right: var(--space-md, 15px);
    color: var(--color-text-muted);
}
/* Tool-specific: Compact and highlight the results group */
.result-group {
    background-color: var(--color-result-group-bg, #fff);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 10px);
    padding: var(--space-sm, 10px);
    border-radius: var(--border-radius-md, 6px);
    margin-bottom: var(--space-md, 15px);
}

/* Print styles */
@media print {
    header, footer, .button-group {
        display: none !important;
    }
    
    .calculator {
        display: block;
        page-break-inside: avoid;
    }
    
    .input-section, /* Removed for global styling compatibility:
/* Removed for global styling compatibility:
.output-section {
        width: 100%;
        box-shadow: none;
        border: 1px solid #ddd;
    }
*/
*/
    
    body, html {
        background: white;
        font-size: 12pt;
    }
    
    .container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Removed for global styling compatibility:
.reference-section {
        page-break-before: always;
    }
*/
}




