/* Modal Background */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal Content */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0; /* Remove padding from the content container */
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    display: flex;
    flex-direction: column; /* Use column direction to ensure proper layout */
    height: 80%; /* Adjust the height of the modal */
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    background-color: #f1f1f1; /* Optional: Background color for the header */
}

/* Close Button */
.close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
}

/* Modal Body */
.modal-body {
    overflow-y: auto; /* Enable vertical scrolling */
    flex: 1; /* Take up remaining space */
    padding: 10px;
    box-sizing: border-box; /* Ensure padding is included in the total width/height */
}

/* Profile Container */
.profile-container {
    display: flex;
    justify-content: space-between;
}

/* Details Section */
.details-section {
    flex: 2;
    margin-right: 20px;
}

/* Image Section */
.image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Profile Image */
.profile-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 10%;
    object-fit: cover;
    border: 1px solid #888;
}

/* for name below image */
.name {
    text-align: center;
    padding-top: 10px;
    font-weight: 600;
}

/* Table */
.modal-body table {
    width: 100%;
    border-collapse: collapse;
}

.modal-body th,
.modal-body td {
    padding: 8px;
    text-align: left;
    border: 1px solid #888;
}

.modal-body th {
    font-weight: 500;
    background-color: #fff;
    width: 30%;
}

.modal-body thead tr td { 
    font-weight: bold;
}
.head th {
    font-weight: bold;
}

/* for table data hiding */
.none {
    display: none;
}

.btn-view {
    margin-top: 10px;
}

.container {
    margin: 0 auto;
    padding: 20px; /* Optional, for inner spacing */
}

/* card hover */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .row-cols-md-4 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .container {
        padding: 5px; /* Optional, for inner spacing */
    }
}

@media (max-width: 576px) {
    .row-cols-md-4 > * {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .modal-content {
        width: 90%;
        max-width: 100%;
        margin: 10% auto; /* Adjust margin for better spacing */
    }

    .profile-container {
        flex-direction: column;
        align-items: center; /* Center align the content */
    }

    .details-section {
        margin-right: 0;
        margin-bottom: 20px;
        width: 100%; /* Make it full width */
    }

    .image-section {
        width: 100%; /* Make it full width */
        text-align: center; /* Center align the content */
        order: -1; /* Ensure this section comes first */
    }

    .profile-image {
        max-width: 100%;
        max-height: 150px;
        border-radius: 50%; /* Make it round */
        object-fit: cover;
        border: 1px solid #888;
    }

    .name {
        text-align: center;
        padding-top: 10px;
        font-weight: 600;
    }

    .modal-body table {
        font-size: 0.9rem; /* Adjust font size for better readability on small screens */
    }

    .modal-body th,
    .modal-body td {
        padding: 6px; /* Reduce padding for better spacing */
    }
}
