/**
 * Utleiekalk FINN - Main Stylesheet
 *
 * This is the main CSS file that imports all component styles.
 * Edit individual component files for specific styling needs.
 *
 * @package Utleiekalk_FINN
 * @version 0.20.0
 */

/* Load Inter font from Google Fonts - MUST BE FIRST */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Font protection from theme override */
@import url('components/font-protection.css');

/* Button protection from theme override */
@import url('components/button-protection.css');

/* CSS Variables (colors, spacing, etc.) */
@import url('variables.css');

/* Elementor and page builder compatibility */
@import url('components/elementor-compat.css');

/* Form components (inputs, buttons, grid) */
@import url('components/forms.css');

/* UI components (cards, sections, metrics) */
@import url('components/components.css');

/* FINN URL field with inline button */
@import url('components/finn-url.css');

/* Sticky results widget */
@import url('components/sticky-widget.css');

/* Mobile responsiveness fixes */
@import url('components/mobile-fix.css');

/* Simulation over time */
@import url('components/simulation.css');

/* Informasjon section (FINN integration with image) */
@import url('components/informasjon.css');

/* Sticky actions panel (left side menu) */
@import url('components/sticky-actions-panel.css');

/* Rental calculator UI improvements (spacing, typography, hierarchy) */
@import url('components/rental-ui-improvements.css');

/* Heading weight fix - reduce boldness from 800 to 600 */
@import url('components/heading-weight-fix.css');

/* FINN rate limit confirmation modal */
@import url('components/finn-limit-modal.css');

/* Market rent research feature (FINN.no and Hybel.no search) */
@import url('components/market-rent-research.css');

/**
 * Note: If you need to add custom styles specific to a page or feature,
 * create a new file in assets/css/components/ and import it here.
 *
 * Example:
 * @import url('components/comparison.css');
 */

/* =================================================================
   STICKY TABLE OF CONTENTS (Right Side - Desktop Only)
   ================================================================= */

/* Only show on desktop */
@media screen and (min-width: 769px) {
    .sticky-toc {
        position: fixed;
        right: 0;
        top: 120px;
        z-index: 9997;
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 40px;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    .sticky-toc:hover {
        width: 220px;
    }

    .sticky-toc > * {
        pointer-events: auto;
    }

    /* Individual TOC items */
    .toc-item {
        position: relative;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
        background: white;
        border-top: 1px solid #e5e7eb;
        box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    background 0.2s ease;
        padding: 0;
    }

    .toc-item:first-child {
        border-radius: 8px 0 0 0;
        border-top: none;
    }

    .toc-item:last-child {
        border-radius: 0 0 0 8px;
    }

    /* Active item sticks out to the left */
    .toc-item.active {
        transform: translateX(-15px);
        box-shadow: -4px 0 8px rgba(0, 0, 0, 0.15);
    }

    /* Number - always visible */
    .toc-item .toc-number {
        min-width: 40px;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 700;
        color: #09B87D;
        flex-shrink: 0;
    }

    /* Label - hidden by default, visible on hover */
    .toc-item .toc-label {
        opacity: 0;
        font-size: 14px;
        font-weight: 500;
        color: #1b1f23;
        white-space: nowrap;
        padding-right: 16px;
        transition: opacity 0.3s ease;
    }

    /* Show label when TOC is hovered */
    .sticky-toc:hover .toc-item .toc-label {
        opacity: 1;
    }

    /* Hover effect on individual item */
    .toc-item:hover {
        background: #f9fafb;
    }

    /* Active item styling */
    .toc-item.active .toc-number {
        color: #078f63;
        font-size: 18px;
    }

    /* Special styling for Results section (last item) */
    .toc-item[data-section="results-section"] {
        background: #09B87D;
    }

    .toc-item[data-section="results-section"] .toc-number {
        color: white;
    }

    .toc-item[data-section="results-section"] .toc-label {
        color: white;
    }

    .toc-item[data-section="results-section"]:hover {
        background: #078f63;
    }

    /* Active state for results section */
    .toc-item[data-section="results-section"].active .toc-number {
        color: white;
        font-size: 18px;
    }
}

/* Hide on mobile/tablet */
@media screen and (max-width: 768px) {
    .sticky-toc {
        display: none;
    }
}

/* =================================================================
   MOBILE ACTION BUTTONS
   ================================================================= */

/* Hide on desktop */
@media screen and (min-width: 769px) {
    .mobile-actions {
        display: none;
    }
}

/* Show on mobile/tablet */
@media screen and (max-width: 768px) {
    .mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        padding: 0 16px;
    }

    .mobile-actions .uk-btn-block {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
    }

    .mobile-actions .uk-btn-block svg {
        flex-shrink: 0;
    }
}
