/* Responsive utility styles for  app */

body {
    font-size: 1rem;
}

.required-star {
    color: #dc3545;
    font-weight: 700;
}

.alert[data-form-error-banner] {
    margin-bottom: 1rem;
}

/* ESAS-r Assessment Styles */
.esas-symptoms-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.esas-symptom-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
}

.esas-scale-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.esas-scale-buttons {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.esas-scale-buttons .btn {
    border-color: #6c757d;
    color: #6c757d;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.esas-scale-buttons .btn.active {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Sidebar Quick Links Styles */
.sidebar-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.quick-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
}

.quick-link:hover {
    background-color: #e9ecef;
    color: #212529;
    text-decoration: none;
}

/* Searchable UID combobox */
.uid-combobox {
    position: relative;
}

.uid-combobox-select {
    display: none;
}

.uid-combobox-menu {
    position: absolute;
    z-index: 1050;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* Body Diagram Canvas Styles */
.body-diagram-container {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    margin-bottom: 20px;
}

.canvas-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dot-counter {
    font-weight: 600;
    color: #dc3545;
}

/* ESAS-r Display Styles */
.esas-display-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.esas-symptom-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.esas-symptom-display:last-child {
    border-bottom: none;
}

.esas-score {
    font-weight: 600;
    color: #dc3545;
    font-size: 1.1rem;
}

/* Body Diagram Display */
.body-diagram-display {
    max-width: 100%;
    height: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* Mobile Responsiveness for ESAS */
@media (max-width: 767.98px) {
    .esas-scale-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .esas-scale-buttons {
        justify-content: space-between;
    }
    
    .esas-scale-buttons .btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .canvas-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .esas-symptom-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

.card {
    border-radius: 10px;
}

@media (max-width: 767.98px) {
    .sidebar {
        min-height: auto !important;
        border-right: none !important;
        margin-bottom: 1rem;
    }
    .sidebar .list-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .sidebar .list-group-item {
        flex: 1 1 100%;
        text-align: center;
        margin-bottom: 0.25rem;
    }
    .navbar .container-fluid, .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar .fw-bold, .navbar .navbar-brand {
        font-size: 1.1rem;
    }
    main[class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .card {
        margin-bottom: 1rem;
    }
    .row > [class^="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .table-responsive {
        overflow-x: auto;
    }
}

.table-responsive {
    width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Report table overflow fixes */
#report-table {
    min-width: 1200px;
    width: 100%;
    table-layout: auto;
}

#report-table thead th {
    white-space: nowrap;
    min-width: 80px;
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

#report-table tbody td {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
}

/* Specific column widths */
#report-table th:nth-child(1),
#report-table td:nth-child(1) { min-width: 120px; }

#report-table th:nth-child(2),
#report-table td:nth-child(2) { min-width: 140px; }

#report-table th:nth-child(3),
#report-table td:nth-child(3) { min-width: 130px; }

#report-table th:nth-child(4),
#report-table td:nth-child(4) { min-width: 110px; }

#report-table th:nth-child(5),
#report-table td:nth-child(5) { min-width: 80px; }

#report-table th:nth-child(6),
#report-table td:nth-child(6) { min-width: 70px; }

#report-table th:nth-child(7),
#report-table td:nth-child(7) { min-width: 140px; }

#report-table th:nth-child(8),
#report-table td:nth-child(8) { min-width: 140px; }

#report-table th:nth-child(9),
#report-table td:nth-child(9) { min-width: 140px; }

#report-table th:nth-child(10),
#report-table td:nth-child(10) { min-width: 100px; }

#report-table th:nth-child(11),
#report-table td:nth-child(11) { min-width: 100px; }

/* Hover effect to show full text on tooltip */
#report-table tbody td {
    cursor: pointer;
}

#report-table tbody td:hover {
    overflow: visible;
    white-space: normal;
    z-index: 20;
    background-color: #f8f9fa;
    position: relative;
}

/* Top Scrollbar Styles */
.top-scrollbar-container {
    position: relative;
    width: 100%;
    height: 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.top-scrollbar {
    height: 100%;
    background: linear-gradient(to right, #80bdff, #0d6efd);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 50px;
    width: 10%;
}

.top-scrollbar:hover {
    background: linear-gradient(to right, #0d6efd, #0d6efd);
    opacity: 0.9;
}

/* Pagination Controls */
#pagination-info {
    font-size: 0.9rem;
}

.btn-group .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-outline-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .navbar .me-3 {
        margin-right: 0 !important;
        display: block;
        margin-bottom: 0.5rem;
    }
    .navbar .btn-link, .navbar .btn-outline-light {
        width: 100%;
        margin-top: 0.5rem;
    }
    .card-header h3, .card-header h4 {
        font-size: 1.1rem;
    }
    
    #report-table {
        min-width: 800px;
        font-size: 0.85rem;
    }
    
    #report-table thead th {
        min-width: 70px;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    #report-table tbody td {
        max-width: 100px;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}
