/**
 * Utleiekalk FINN - Main Stylesheet
 *
 * Component CSS files are loaded via wp_enqueue_style in class-plugin.php
 * for parallel browser downloads (no @import waterfall).
 *
 * This file contains only the sticky TOC and mobile action button styles.
 *
 * @package Utleiekalk_FINN
 * @version 2.7.5
 */

/* =================================================================
   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;
    }
}
