/**
 * Up & Down Mode - Specific Styles
 * Separate CSS to avoid impacting americano.html
 */

/* ===== BASE LAYOUT ===== */
body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

.container-fluid {
    overflow-y: visible;
    height: auto;
}

/* Main container with proper scroll */
main.container {
    padding-bottom: calc(80px + 2rem); /* Space for bottom navigation */
    overflow-y: visible;
    min-height: auto;
}

/* ===== SCREENS ===== */
.screen {
    animation: fadeIn 0.3s ease-in-out;
    overflow-y: visible;
    height: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bottom-nav-content.config-nav {
    justify-content: flex-end; /* Align button to the right */
}

.screen.d-none .bottom-nav {
    display: none !important;
}

/* Override flexbox for results navigation to allow grid to work */
.bottom-nav-content.results-nav {
    display: block;
}

/* Results navigation grid layout */
.results-nav-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

/* Position elements in grid */
.results-nav-grid > button:first-child {
    justify-self: start;
}

.results-nav-grid > button:last-child {
    justify-self: end;
}

/* Group round navigation elements together */
.round-nav-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    main.container {
        padding-bottom: 100px;
    }

    .bottom-nav {
        padding: 0.75rem;
    }

    /* Hide "Tour" label on mobile to save space */
    .tour-label {
        display: none;
    }

    /* Transform Bootstrap buttons to round on tablet */
    .bottom-nav .btn {
        min-width: 48px !important;
        height: 48px !important;
        padding: 0.75rem !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important;
        flex: 0 0 auto !important;
        width: 48px !important;
    }

    .bottom-nav .btn-lg {
        min-width: 56px !important;
        height: 56px !important;
        padding: 1rem !important;
        flex: 0 0 auto !important;
        width: 56px !important;
    }

    /* Show only icons, no text */
    .bottom-nav .btn i {
        margin: 0 !important;
        font-size: 1.25rem !important;
    }

    /* Grid layout for results navigation - single line */
    .results-nav-grid {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0.5rem !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* Group round navigation elements together */
    .round-nav-group {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important;
    }

    /* Compact badge for round navigation */
    .round-nav-group .badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
        min-width: 50px !important;
    }
}

@media (max-width: 575px) {
    main.container {
        padding-bottom: 90px;
    }

    .bottom-nav {
        padding: 0.5rem;
    }

    .bottom-nav-content {
        gap: 0.75rem;
    }

    /* Round buttons more compact on small mobile */
    .bottom-nav .btn {
        min-width: 44px !important;
        height: 44px !important;
        padding: 0.625rem !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important;
        flex: 0 0 auto !important;
        width: 44px !important;
    }

    .bottom-nav .btn-lg {
        min-width: 52px !important;
        height: 52px !important;
        padding: 0.875rem !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important;
        flex: 0 0 auto !important;
        width: 52px !important;
    }

    .bottom-nav .btn i {
        margin: 0 !important;
        font-size: 1.125rem !important;
    }

    /* Grid layout for small mobile - even more compact */
    .results-nav-grid {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0.4rem !important;
    }

    /* Tighter grouping on small mobile */
    .round-nav-group {
        gap: 0.2rem !important;
    }

    /* Even more compact badge for small mobile */
    .round-nav-group .badge {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.5rem !important;
        min-width: 45px !important;
    }
}

/* ===== ENSURE SCROLL WORKS ===== */
html {
    overflow-y: auto;
    height: auto;
}

body {
    overflow-y: auto;
    height: auto;
}

#app-content {
    overflow-y: visible;
    height: auto;
    min-height: 100vh;
}

/* ===== COLLAPSIBLE SECTIONS ===== */
.config-section-title[data-bs-toggle="collapse"] {
    transition: all 0.3s ease;
}

.config-section-title[data-bs-toggle="collapse"]:hover {
    opacity: 0.7;
}

.config-section-title[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.3s ease;
}

.config-section-title[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

.config-section-title[data-bs-toggle="collapse"].collapsed .bi-chevron-down {
    transform: rotate(0deg);
}
