﻿/***************************************************************************************
 * Ontario TECK VBA Developers
 * License - 2023/2026
 *
 * Location : D:\Curriculum Vitae\ASP.Net 6\CV\wwwroot\css\
 * Filename : pain\paincontrol.css
 *
 * Date Created: 2026-04-27 6:39:34 AM
 *
 * Main features
 *   Correct flexbox rules for scrollable regions
 *   Full-height layout behavior for body panels
 *   Grid-table responsiveness + sticky headers
 *   Mobile-friendly stacked layout
 *   btn btn-primary apply-filter-btn
 ***************************************************************************************/

/* Make the desktop layout intentionally horizontal and compact */
.options-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.date-range-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.apply-filter-block {
    margin-left: auto;
}

@media (max-width: 768px) {
    .options-row {
        align-items: stretch;
        gap: 1rem;
    }

    /* PRIORITY: Dates first */
    .date-range-wrapper {
        order: 1;
        align-items: stretch;
        gap: 0.5rem;
    }

        .date-range-wrapper .date-box {
            width: 100%;
        }

    .date-separator {
        text-align: center;
        margin: 0.25rem 0;
    }

    /* Button second, full width */
    .apply-filter-block {
        order: 2;
    }

    .apply-filter-btn {
        width: 100%;
    }

        .apply-filter-btn.btn-disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

    /* Optional: hide or collapse */
    .weekend-block {
        order: 3;
        font-size: 0.9rem;
        opacity: 0.85;
    }

    .source-block {
        order: 4;
    }
}
/* Mobile re‑organization (THIS fixes the height issue) */

/* Collapse Source / Weekend on mobile */
@media (max-width: 768px) {
    .source-block {
        display: none;
    }
}
/* Responsive design is re‑ordering, not just stacking. This CSS just 
    tells the browser what matters on small screens. */

/** Lookup cards */
#lookupsection {
    height: 100%;
    overflow-y: auto;
}

.lookup-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.lookup-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.lookup-card {
    border: 2px solid #3f51ff;
    padding: 6px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.lookup-title {
    font-weight: bold;
    color: #3f51ff;
}

/* Filter Bar */
.apply-filter-block {
    display: flex;
    align-items: center;
    margin-left: auto; /* pushes button to the far right */
}

.apply-filter-btn {
    width: 150px;
    padding: 10px 18px;
    font-weight: 600;
}

/* Grid Table Layout */
/* Hover highlight for rows */
.grid-row:hover {
    background-color: #e9f3ff; /* soft blue */
    cursor: pointer;
}

/* Optional: highlight selected row */
.grid-row.selected {
    background-color: #c7e0ff !important;
    border-left: 4px solid #0078d4;
}

.grid-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* GRID STRUCTURE */
    display: grid;
    grid-template-columns: 150px 2fr 130px 130px;
    gap: 6px;
    padding: 0
}

.grid-table-meds {
    grid-template-columns: 110px 320px 100px 100px 130px !important;
}

.grid-header {
    position: sticky;
    top: 0;
    background: #f2f2f2;
    z-index: 5;
    padding: 6px 4px;
    border-bottom: 1px solid #ccc;
    max-height: 80px;
}

.grid-row {
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 4px;
}

/* Mobile Stacked “Card” View */
@media (max-width: 768px) {
    .grid-table {
        grid-template-columns: 1fr !important;
        overflow-y: visible !important;
        max-height: none !important;
    }

    .grid-header {
        display: none !important;
    }

    .grid-row {
        border: 1px solid #e0e0e0;
        padding: 8px;
        margin-bottom: 8px;
        border-radius: 4px;
    }

    .grid-cell-label {
        font-weight: 600;
        color: #555;
    }

    .grid-hideme {
        display: none !important;
    }
}

/* Pain Working Area (Two-column layout) */
.painworking-wrapper {
    height: 100%;
    min-height: calc(100vh - 160px); /* preserve original design */
    /* Scroll fix patch */
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
}

.painworking-body,
.flex-nowrap {
    display: flex;
    flex-wrap: nowrap;
    height: 100%;
    min-height: 0 !important; /* CRITICAL for scroll to work */
}

.left-col,
.right-col {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0 !important; /* allows children to shrink */
}

.left-col {
    flex: 0 0 66.666%;
}

.right-col {
    flex: 0 0 33.333%;
    border-left: 1px solid #ccc;
}

/* Options Bar / Filter Bar */
.options-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    flex-wrap: nowrap;
}

.weekend-block {
    display: flex;
    align-items: center;
}

.date-range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-box {
    width: 170px;
}

.date-separator {
    font-weight: 600;
}

.source-block {
    display: flex;
    align-items: center;
}

.source-type-box {
    border: 1px solid #777;
    padding: 12px 20px;
    border-radius: 6px;
    background: #fff7ec;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 360px;
}

.source-type-legend {
    font-size: 0.8rem;
    padding: 0 6px;
    margin-left: -12px !important;
    margin-top: -35px !important;
}

.source-content {
    display: flex;
    align-items: center;
    gap: 25px;
    padding-top: 5px;
}

.source-item {
    font-weight: 500;
}

.date-range-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Main Pain Control Page Sections */
.paincontrol-container {
    width: 100%;
    margin: auto;
    min-height: 0;
}

.pcm-body {
    background: #f4fff4;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
}

.pcm-info {
    background: #f8f8f8;
}

.pcm-options {
    background: #fff7ec;
}

.pcm-section {
    margin-bottom: 3px;
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.pcm-section-inner {
    margin-bottom: 3px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.option-block label {
    margin-right: 8px;
    font-weight: 600;
}

.placeholder-text {
    color: #666;
    font-style: italic;
}

/* Reset Utility Classes */

.no-gap {
    padding: 0 !important;
    margin: 0 !important;
}

/* Phone Device Responsiveness rules */
/* Hide Info section on small devices */
@media (max-width: 767.98px) {
    #info-section,
    .weekend-block,
    .lookup-option,
    .source-block {
        display: none;
    }
}
/* Mobile layout for Options / Filters */
@media (max-width: 767.98px) {

    #options-pane .options-row {
        display: flex;
        gap: 0.75rem;
    }

    #options-pane .date-range-wrapper,
    #options-pane,
    #options-pane .apply-filter-block {
        width: 100%;
    }
}

@media (max-width: 767.98px) {

    #options-pane .date-range-wrapper {
        display: flex;
        gap: 0.5rem;
    }

        #options-pane .date-range-wrapper .date-to-separator {
            display: none; /* hide the "to" text if you use one */
        }
}

@media (max-width: 767.98px) {

    #options-pane .apply-filter-block {
        display: flex;
        justify-content: center;
    }

    #options-pane .apply-filter-btn {
        width: 100%;
    }
}

/***************************************************************************************
 * Ontario TECK VBA Developers
 * License - 2023/2026
 * Normalize CSS classes
 *
 * Response Copilot: CV.Documents\Copilot Replies\Normalize View Classes Respond.md
 * Source File: CV.Documents\PowerApps\markdown\Normalize View Classes.md
 ***************************************************************************************/
.app-container {
    height: 57vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-flex-column {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .main-flex-column .partial-container {
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

.flex-fill-scroll {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.scroll-y {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

/***************************************************************************************
 * Ontario TECK VBA Developers
 * License - 2023/2026
 *
 * Pain Cards (SharePoint)
 ***************************************************************************************/
.pain-card {
    border-left: 4px solid #0d6efd;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .pain-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    }

    .pain-card .card-title {
        font-weight: 600;
    }

    .pain-card .badge {
        font-size: 0.75rem;
    }

.pain-low {
    border-left-color: #198754;
}

.pain-medium {
    border-left-color: #ffc107;
}

.pain-high {
    border-left-color: #dc3545;
}

/***************************************************************************************
 * Ontario TECK VBA Developers
 * License - 2023/2026
 *
 * Show records in red when not transferred to SharePoint
 ***************************************************************************************/
.grid-row {
    color: black;
}

    .grid-row.not-transferred {
        color: midnightblue;
    }
