/* Custom styles for Record GRI */

/* Login form */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Dashboard table */
.table-responsive {
    overflow-x: auto;
    min-height: 300px;
}

/* Ensure the table takes full width */
.table {
    width: 100%;
    min-width: 1200px; /* Ensures horizontal scrolling on small screens */
}

.table th, .table td {
    vertical-align: middle;
}

.table .details-cell {
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
}

.table .request-number-cell,
.table .incoming-order-number-cell {
    max-width: 100px;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.9em;
    vertical-align: middle;
}

.table .request-number-cell strong {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.1em;
    display: block;
}

.table .incoming-order-number-cell strong {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1em;
    display: block;
}

.table img.thumbnail {
    width: 300px;
    height: 300px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: transform 0.2s;
    max-width: 100%;
}

.table img.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Add a container for the image to maintain layout */
.table .image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

/* Entry form */
.entry-form {
    max-width: 800px;
    margin: 0 auto;
}

/* Image preview */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    margin-top: 10px;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 20px;
}

/* Admin panel */
.admin-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* User role update form */
.admin-section .input-group-sm {
    width: 100%;
}

.admin-section .form-select-sm {
    max-width: 100px;
}

/* Modal for image preview */
.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-xl {
    max-width: 90%;
}

/* View Entry page styles */
.entry-table-container {
    overflow-x: auto;
    max-width: 100%;
    display: block;
    width: 100%;
}

.entry-details-table {
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
    max-width: 100%;
    border-collapse: collapse;
}

.entry-details-table th {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
    width: 20%;
    vertical-align: top;
}

.entry-details-table td {
    width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: left;
}

.card-header.bg-primary {
    background-color: #0d6efd !important;
}

.card-header.bg-primary .card-title {
    color: white;
    font-weight: 600;
}

.entry-details-table th,
.entry-details-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

/* Fix for table extending under image */
.col-md-6 {
    max-width: 50%;
}

.card-body.p-0 {
    padding: 0 !important;
}

.card .img-fluid {
    width: 100%;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Action buttons and icons */
.btn-group .btn {
    margin-right: 2px;
}

.btn i.bi {
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Footer styles */
.footer {
    margin-top: 50px;
    border-top: 1px solid #ddd;
}

.footer p {
    font-size: 0.9rem;
    color: #555;
}

/* Make sure the footer stays at the bottom */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .col-md-6 {
        max-width: 100%;
    }

    .entry-table-container {
        overflow-x: hidden;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .btn i.bi {
        font-size: 0.875rem;
    }

    .footer p {
        font-size: 0.8rem;
    }

    /* Adjust image size on smaller screens */
    .table img.thumbnail {
        width: 200px;
        height: 200px;
    }

    /* Make sure the request number and incoming order number cells are readable on mobile */
    .table .request-number-cell,
    .table .incoming-order-number-cell {
        font-size: 0.8em;
        max-width: 80px;
    }

    .table .request-number-cell strong,
    .table .incoming-order-number-cell strong {
        font-size: 0.95em;
    }
}
