/* Mobile-First Responsive CSS for PTRCF Application */

.RadMenu ul.rmActive, .RadMenu ul.rmRootGroup {
    display: block;
    background: #709749;
}

/* Gap utility for flex containers */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Mobile tank edit form styling */
.d-flex {
    display: flex;
}

.justify-content-end {
    justify-content: flex-end;
}

/* Ensure proper spacing for mobile forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* Card styling for mobile tank list */
.card {
    border: 1px solid #ddd;
    border-radius: 0.25rem;
}

.card-body {
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.card-text {
    margin-bottom: 0.5rem;
}

/* Background for edit panel */
.bg-light {
    background-color: #f8f9fa !important;
}

/* Base mobile styles */
@media (max-width: 576px) {

    .ndhealth #containerfull {
    }

    body {
        font-size: 13px;
    }

    h1, .h1 {
        font-size: 1.5rem;
    }

    h2, .h2 {
        font-size: 1.3rem;
    }

    h4, .h4 {
        font-size: 1.1rem;
    }

    h5, .h5 {
        font-size: 1rem;
    }

    /* Buttons - make them full width on mobile */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group {
        display: flex !important;
        flex-direction: column;
    }

    .btn-group .btn {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    /* Keep action buttons inline on mobile */
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: auto;
        flex: 1;
    }

    /* Fix form controls on mobile */
    .form-control, 
    .form-select,
    .RadComboBox {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Cards - better spacing on mobile */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Tables - horizontal scroll on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Grid headers - smaller text */
    .RadGrid .rgHeader {
        font-size: 12px;
    }

    /* Navigation improvements */
    #topbar img,
    #logobar img {
        display: block;
        margin: 5px auto;
    }

    /* Improve spacing of form labels */
    .form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    /* Better spacing for validation messages */
    .small {
        display: block;
        margin-top: 0.25rem;
    }

    /* Page title adjustments */
    .page-title {
        padding: 1rem 0;
    }

    .page-description {
        padding: 1rem 0.5rem;
    }

    /* Alert adjustments */
    .alert {
        padding: 0.75rem;
        font-size: 13px;
    }

    /* Hide unnecessary elements on very small screens */
    .d-sm-none {
        display: none !important;
    }

    /* Improve readability of data labels */
    strong {
        display: inline;
        margin-bottom: 0.25rem;
    }

    /* Fix action panel width */
    .action-label {
        font-weight: bold;
        display: block;
        margin-bottom: 1rem;
    }

    /* RadListBox improvements */
    .RadListBox {
        width: 100% !important;
    }

    /* Grid column header text wrapping */
    .RadGrid table th {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}











/* Tablet and larger screens */
@media (min-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Allow side-by-side buttons on tablets */
    .btn-group .btn {
        margin-right: 0.5rem;
        width: auto;
    }

    /* Sidebar/action panel improvements */
    .card {
        margin-bottom: 1.5rem;
    }
}

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    body {
        font-size: 14px;
    }

    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Telerik Controls Responsive Adjustments */

/* RadGrid responsive */
.RadGrid {
    width: 100% !important;
}

.RadGrid_Default {
    background-color: #fff;
    border-collapse: collapse;
}

/* Telerik menu improvements */
.telerik_RadMenu_Default {
    flex-wrap: wrap;
}

.telerik_RadMenu_Default .rmItem {
    white-space: normal;
    padding: 0.5rem;
}

/* Better spacing for combo boxes */
.RadComboBox {
    width: 100% !important;
}

/* Form improvements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Validation styling */
.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    display: block;
    margin-top: 0.25rem;
}

/* Improve footer visibility on all devices */
#footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #ddd;
}

#footer p {
    margin: 0.5rem 0;
    font-size: 12px;
}

/* Message/Alert styling */
#messageAlert,
#errorAlert {
    margin-bottom: 1rem;
}

/* Row information display */
.row.mb-2 {
    margin-bottom: 0.5rem !important;
}

/* Improve button focus for accessibility */
.btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Better link styling */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Improve textarea on mobile */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Card improvements for mobile */
.card-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.card-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Better spacing for content area */
#contentarea {
    padding-bottom: 2rem;
}

/* Improve readability of long text */
p, li {
    line-height: 1.6;
}

/* Telerik RadListBox improvements */
.RadListBox .rlbItem {
    padding: 0.5rem;
    white-space: normal;
    word-wrap: break-word;
}

/* Print styles */
@media print {
    .btn,
    #menubar,
    #topbar,
    .no-print {
        display: none !important;
    }

    body {
        background-color: #fff;
    }

    .container-fluid {
        max-width: 100%;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
