/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 12px;
    background-color: #f5f5f5;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Heading Styles */
h4, h5, h6 {
    font-size: 12px;
}

/* Layout */
.container {
    display: block;
    height: 100vh;
    padding: 20px;
    position: relative;
}

.left-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.overlay-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    height: auto;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.overlay.show .overlay-panel {
    transform: translate(-50%, -50%) scale(1);
}

/* Sticky Header */
.overlay-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    border-radius: 12px 12px 0 0;
}

.overlay-title {
    flex: 1;
    margin: 0;
}

.overlay-title h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.overlay-title p {
    margin: 4px 0 0 0;
    color: #6c757d;
    font-size: 14px;
}

.overlay-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.overlay-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #007bff;
    color: white;
    font-size: 16px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.overlay-action-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.overlay-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.overlay-close-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: scale(1.1);
}

.overlay-content {
    padding: 25px;
    height: 100%;
    max-height: calc(90vh - 80px); /* Subtract header height */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling for overlay content */
.overlay-content::-webkit-scrollbar {
    width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive overlay */
@media (max-width: 768px) {
    .overlay-panel {
        width: 95vw;
        height: 95vh;
        max-width: none;
        max-height: none;
    }

    .overlay-header {
        padding: 15px 20px;
    }

    .overlay-content {
        padding: 0 20px 20px 20px;
        max-height: calc(95vh - 70px);
    }

    .overlay-title h2 {
        font-size: 18px;
    }

    .overlay-close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* Table Section */
.table-section {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Pagination Section */
.pagination-container {
    flex-shrink: 0;
}
