/* operator-reg-table-display.css */

/* Inter font family - local variable font */
@font-face {
    font-family: 'Inter';
    src: url('./Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

/* Row number styling */
.operator-reg-table td.row-number {
    text-align: center;
    background-color: #f8f8f8;
    font-weight: 500;
    width: 60px;
}

.operator-reg-table th[data-col="row-number"] {
    text-align: center;
    width: 60px;
}

/* Controls styling */
.operator-reg-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.operator-reg-table-search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    height: 40px !important; /* Force height */
    min-height: 40px !important;
    padding: 8px 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    -webkit-appearance: none; /* Remove default iOS styling */
    appearance: none;
    transition: all 0.3s ease !important;
    outline: none !important;
}

.operator-reg-table-search:focus {
    border-color: #4a90e2 !important; /* Blue highlight color */
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important; /* Subtle glow effect */
}

.rows-per-page-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.rows-per-page-control label {
    color: #666;
    font-size: 14px;
}

.rows-per-page-select {
    height: 40px !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: white !important;
    cursor: pointer;
    font-size: 14px !important;
    min-width: 70px;
    line-height: normal !important;
    box-sizing: border-box !important;
    -webkit-appearance: none; /* Remove default iOS styling */
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px !important;
}

/* Responsive adjustments for controls */
@media (max-width: 768px) {
    .operator-reg-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .operator-reg-table-search {
        width: 100%;
        max-width: 100%;
    }

    .rows-per-page-control {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .rows-per-page-control {
        justify-content: flex-start;
    }
    
    .rows-per-page-select {
        padding: 6px 8px;
    }
}

/* Pagination styling */
.operator-reg-pagination-wrapper {
    position: relative;
    width: 100%;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.operator-reg-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: auto;
    min-width: 320px;
    max-width: 90%;
    margin: 0 auto;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    white-space: nowrap;
}

.pagination-button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-button:hover {
    background-color: #f0f0f0;
}

.pagination-button:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-number.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.page-number:hover:not(.active) {
    background-color: #f0f0f0;
}

.pagination-info {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    white-space: nowrap;
}

/* General table styling */
.operator-reg-table-container {
    overflow-x: auto; /* Enables horizontal scrolling */
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 8px; /* Rounded corners for the container */
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); /* Subtle shadow */
    background-color: #fff;
    position: relative; /* For scroll shadow */
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    
    /* Hide scrollbar for cleaner look while keeping functionality */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #888 #f1f1f1; /* Firefox */
}

.operator-reg-table-container::-webkit-scrollbar {
    height: 8px; /* Horizontal scrollbar height */
}

.operator-reg-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.operator-reg-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.operator-reg-table-container::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Scroll shadows */
.operator-reg-table-container::before,
.operator-reg-table-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.operator-reg-table-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

.operator-reg-table-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), rgba(255,255,255,0));
}

.operator-reg-table-container.scroll-left::before {
    opacity: 1;
}

.operator-reg-table-container.scroll-right::after {
    opacity: 1;
}

.operator-reg-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    min-width: 1200px; /* Adjusted to ensure all columns are visible with scroll */
    
    /* Prevent text selection while scrolling */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.operator-reg-table th,
.operator-reg-table td {
    border: 1px solid #e0e0e0; /* Lighter border for a cleaner look */
    padding: 15px 10px; /* More padding for better readability */
    text-align: right; /* Align text to the right for RTL languages */
    vertical-align: middle;
    white-space: normal; /* Allow text wrapping in cells */
}
.operator-reg-table th {
    background-color: #f8f8f8; /* Light gray background for headers */
    font-weight: bold;
    color: #333;
    text-transform: uppercase; /* Optional: Make headers uppercase */
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.operator-reg-table tbody tr:nth-child(even) {
    background-color: #fefefe; /* Very light alternative row background */
}
.operator-reg-table tbody tr:hover:not(:empty) {
    background-color: #f0f8ff; /* Light blue on hover for rows with data */
    transition: background-color 0.2s ease-in-out;
}
.operator-reg-table td {
    color: #555;
    font-size: 0.9em;
}

/* Date cells specific styling */
.operator-reg-table td:nth-child(12),
.operator-reg-table td:nth-child(13) {
    direction: ltr; /* Force left-to-right for date cells */
    text-align: left; /* Left alignment for consistent date display */
    unicode-bidi: plaintext; /* Ensure numbers maintain their orientation */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .operator-reg-table th,
    .operator-reg-table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    .operator-reg-table {
        min-width: unset; /* Allow table to shrink on smaller screens */
    }
}
@media (max-width: 480px) {
    .operator-reg-table th,
    .operator-reg-table td {
        font-size: 0.8em;
    }
}
