@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.medplore-app {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
}

.medplore-app .container {
    max-width: 1200px;
}

@media (max-width: 991.98px) {
    .medplore-app .container {
        padding: 0;
        width: 100%;
        max-width: none;
    }
    .medplore-app .card,
    .medplore-app .card-header,
    .medplore-app .card-body {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

.medplore-app .card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

.medplore-app .card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
}

.medplore-app .accordion-button:not(.collapsed) {
    color: #fff;
    background-color: #0d6efd;
}

.medplore-app .nav-tabs .nav-link {
    color: #6c757d;
}

.medplore-app .nav-tabs .nav-link.active {
    color: #0d6efd;
    border-color: #dee2e6 #dee2e6 #fff;
}

.medplore-app #results-tab-content .tab-pane {
    padding: 1.5rem;
}

.medplore-app #manual-form-accordion .accordion-item {
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
}

.medplore-app #nightly-score-gauge {
    height: 180px;
}

.medplore-app .list-group-item {
    border-left: 0;
    border-right: 0;
}

@media print {
    .medplore-app body * {
        visibility: hidden;
    }
    .medplore-app .card-body, .medplore-app .card-body * {
        visibility: visible;
    }
    .medplore-app .card-body {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .medplore-app .card-footer, .medplore-app .btn {
        display: none;
    }
    .medplore-app #results-tab-content::after {
        content: "medplore.com/sleep-pattern-analyser";
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: #6c757d;
    }
}

/* Responsive Tab-to-Accordion Styles */
@media (max-width: 991.98px) {
    #results-tabs-desktop {
        flex-direction: column;
        border-bottom: none;
    }

    #results-tabs-desktop .nav-item {
        border-bottom: 1px solid #e9ecef;
    }
    
    #results-tabs-desktop .nav-item:last-child {
        border-bottom: none;
    }

    #results-tabs-desktop .nav-link {
        border: none;
        border-radius: 0;
        width: 100%;
        font-weight: 600;
        padding: 1rem 1.5rem;
    }

    #results-tabs-desktop .nav-link.active {
        background-color: #0d6efd;
        color: #fff;
    }
    
    #results-tabs-desktop .nav-link:not(.active) {
        color: #212529;
    }

    .medplore-app #results-tab-content .tab-pane {
        padding: 1.5rem;
    }

    /* Chart container sizing fixes for mobile */
    #trends-chart-container, 
    #bedtime-heatmap-container,
    #summary-stacked-bar {
        min-height: 250px;
        width: 100%;
    }

    #radar-chart-container {
        min-height: 300px;
        width: 100%;
    }

    /* Horizontal scrolling for wide charts */
    #trends-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    #trends-content > #trends-chart-container,
    #trends-content > #bedtime-heatmap-container {
        min-width: 500px; /* Force a minimum width to prevent squashing */
    }
}