/**
 * Loogman Vacancy Calculator - Frontend Styles
 *
 * Based on the Figma design:
 * - Primary: #003880
 * - Light Grey: #C6C6C6
 * - Dark Grey: #7C7C7B
 * - White: #FFFFFF
 * - Card: rounded-20px, shadow, 32px padding
 * - Heading: Frutiger Black, 22px, line-height 1.4
 * - Body: Frutiger55Roman, 20px, line-height 1.5
 *
 * @package LoogmanVacancyCalculator
 * @since   1.0.0
 */

/* =============================================
   CSS Custom Properties
   ============================================= */
:root {
    --lvc-primary: #003880;
    --lvc-light-grey: #c6c6c6;
    --lvc-dark-grey: #7c7c7b;
    --lvc-white: #ffffff;
    --lvc-black: #0a0b09;
    --lvc-shadow-sm: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
    --lvc-shadow-md: 0px 2px 4px -2px rgba(16, 24, 40, 0.06),
        0px 4px 8px -2px rgba(16, 24, 40, 0.1);
    --lvc-radius-card: 20px;
    --lvc-radius-slider: 4px;
    --lvc-radius-handle: 12px;
    --lvc-spacing-card: 32px;
    --lvc-spacing-content: 16px;
    --lvc-spacing-slider-gap: 8px;
    --lvc-handle-size: 24px;
    --lvc-track-height: 8px;
    --lvc-font-heading: "Frutiger", "Frutiger LT", "Helvetica Neue", Arial, sans-serif;
    --lvc-font-body: "Frutiger55Roman", "Frutiger", "Frutiger LT", "Helvetica Neue", Arial, sans-serif;
    --lvc-font-value: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =============================================
   Calculator Card Container
   ============================================= */
.lvc-calculator {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    background-color: var(--lvc-white);
    border-radius: var(--lvc-radius-card);
    box-shadow: var(--lvc-shadow-sm);
    padding: var(--lvc-spacing-card);
    overflow: hidden;
    position: relative;
    font-family: var(--lvc-font-body);
}

.lvc-calculator *,
.lvc-calculator *::before,
.lvc-calculator *::after {
    box-sizing: border-box;
}

/* =============================================
   Content Wrapper
   ============================================= */
.lvc-calculator__content {
    display: flex;
    flex-direction: column;
    gap: var(--lvc-spacing-content);
    align-items: stretch;
    width: 100%;
}

/* =============================================
   Title
   ============================================= */
.lvc-calculator__title {
    font-family: var(--lvc-font-heading);
    font-size: 20px !important;
    font-weight: 900;
    line-height: 1.4;
    color: #003880 !important;
    margin: 0;
    padding: 0;
    letter-spacing: 0;
    white-space: normal;
    word-wrap: break-word;
}

/* =============================================
   Sliders Container
   ============================================= */
.lvc-calculator__sliders {
    display: flex;
    gap: var(--lvc-spacing-content);
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

/* =============================================
   Individual Slider
   ============================================= */
.lvc-slider {
    flex: 1 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--lvc-spacing-slider-gap);
    align-items: stretch;
    min-width: 0;
    position: relative;
}

/* =============================================
   Slider Label
   ============================================= */
.lvc-slider__label {
    font-family: var(--lvc-font-body);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--lvc-primary);
    display: block;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* =============================================
   Slider Track Wrapper
   ============================================= */
.lvc-slider__track-wrapper {
    position: relative;
    height: 56px;
    width: 100%;
}

/* =============================================
   Range Input - Custom Styling
   ============================================= */
.lvc-slider__input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: var(--lvc-track-height);
    background: transparent;
    cursor: pointer;
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    z-index: 2;
    outline: none;
}

/* Track - WebKit (Chrome, Safari, Edge) */
.lvc-slider__input::-webkit-slider-runnable-track {
    width: 100%;
    height: var(--lvc-track-height);
    background: var(--lvc-light-grey);
    border-radius: var(--lvc-radius-slider);
    border: none;
    cursor: pointer;
}

/* Track - Firefox */
.lvc-slider__input::-moz-range-track {
    width: 100%;
    height: var(--lvc-track-height);
    background: var(--lvc-light-grey);
    border-radius: var(--lvc-radius-slider);
    border: none;
    cursor: pointer;
}

/* Progress fill - Firefox */
.lvc-slider__input::-moz-range-progress {
    height: var(--lvc-track-height);
    background: var(--lvc-primary);
    border-radius: var(--lvc-radius-slider);
}

/* Thumb - WebKit */
.lvc-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--lvc-handle-size);
    height: var(--lvc-handle-size);
    background: var(--lvc-white);
    border: 1.5px solid var(--lvc-primary);
    border-radius: 50%;
    cursor: pointer;
    margin-top: calc((var(--lvc-track-height) - var(--lvc-handle-size)) / 2);
    box-shadow: var(--lvc-shadow-md);
    position: relative;
    z-index: 3;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.lvc-slider__input::-webkit-slider-thumb:hover {
    box-shadow: var(--lvc-shadow-md), 0 0 0 4px rgba(0, 56, 128, 0.1);
}

.lvc-slider__input::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: var(--lvc-shadow-md), 0 0 0 6px rgba(0, 56, 128, 0.15);
}

/* Thumb - Firefox */
.lvc-slider__input::-moz-range-thumb {
    width: var(--lvc-handle-size);
    height: var(--lvc-handle-size);
    background: var(--lvc-white);
    border: 1.5px solid var(--lvc-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--lvc-shadow-md);
    position: relative;
    z-index: 3;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.lvc-slider__input::-moz-range-thumb:hover {
    box-shadow: var(--lvc-shadow-md), 0 0 0 4px rgba(0, 56, 128, 0.1);
}

.lvc-slider__input::-moz-range-thumb:active {
    transform: scale(1.1);
    box-shadow: var(--lvc-shadow-md), 0 0 0 6px rgba(0, 56, 128, 0.15);
}

/* Focus styles for accessibility */
.lvc-slider__input:focus-visible::-webkit-slider-thumb {
    outline: 2px solid var(--lvc-primary);
    outline-offset: 2px;
}

.lvc-slider__input:focus-visible::-moz-range-thumb {
    outline: 2px solid var(--lvc-primary);
    outline-offset: 2px;
}

/* =============================================
   Slider Value Display (beneath thumb)
   ============================================= */
.lvc-slider__value {
    display: block;
    font-family: var(--lvc-font-value);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--lvc-black);
    text-align: center;
    position: absolute;
    bottom: 0;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    /* Positioned via JS to follow the thumb. */
    transform: translateX(-50%);
    transition: left 0.05s ease-out;
}

/* =============================================
   Divider
   ============================================= */
.lvc-calculator__divider {
    width: 100%;
    height: 1px;
    background-color: var(--lvc-light-grey);
    flex-shrink: 0;
}

/* =============================================
   Result Text
   ============================================= */
.lvc-calculator__result {
    width: 100%;
}

.lvc-calculator__result-text {
    font-family: var(--lvc-font-body);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--lvc-dark-grey);
    margin: 0;
    padding: 0;
    white-space: normal;
    word-wrap: break-word;
}

/* =============================================
   Responsive Design
   ============================================= */

/* Tablet */
@media screen and (max-width: 768px) {
    .lvc-calculator {
        padding: 24px;
    }

    .lvc-calculator__title {
        font-size: 20px;
    }

    .lvc-slider__label {
        font-size: 18px;
    }

    .lvc-calculator__result-text {
        font-size: 18px;
    }
}

/* Mobile */
@media screen and (max-width: 480px) {
    .lvc-calculator {
        padding: 20px;
        border-radius: 16px;
    }

    .lvc-calculator__title {
        font-size: 18px;
    }

    .lvc-calculator__sliders {
        flex-direction: column;
        gap: 12px;
    }

    .lvc-slider {
        width: 100%;
    }

    .lvc-slider__label {
        font-size: 16px;
    }

    .lvc-calculator__result-text {
        font-size: 16px;
    }
}

/* =============================================
   Elementor Compatibility
   ============================================= */
.elementor-widget-shortcode .lvc-calculator {
    width: 100%;
}

.elementor-section .lvc-calculator {
    max-width: 100%;
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .lvc-calculator {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .lvc-slider__input {
        display: none;
    }

    .lvc-slider__value {
        position: static;
        transform: none;
        text-align: left;
    }
}

/* =============================================
   Reduced Motion
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .lvc-slider__input::-webkit-slider-thumb {
        transition: none;
    }

    .lvc-slider__input::-moz-range-thumb {
        transition: none;
    }

    .lvc-slider__value {
        transition: none;
    }
}
