/**
 * Employee Table Styles - sj-table-emp.css
 * Modern Blue & Orange Theme for Employee Table
 */

/* Container หลัก */
.sj-table-container-tb34 {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: #f8fafe;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.08);
}

/* Filter Section */
.sj-table-filters-tb34 {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    align-items: end;
}

.sj-filter-group-tb34 {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.sj-filter-group-tb34 label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #e3f2fd;
    white-space: nowrap;
}

.sj-filter-input-tb34,
.sj-filter-select-tb34 {
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    min-height: 20px;
}

.sj-filter-input-tb34:focus,
.sj-filter-select-tb34:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.3);
    background: #ffffff;
    transform: translateY(-1px);
}

.sj-filter-input-tb34::placeholder {
    color: #666;
    font-style: italic;
}

/* Filter Actions */
.sj-filter-actions-tb34 {
    display: flex;
    gap: 10px;
    align-items: end;
}

.sj-clear-btn-tb34,
.sj-refresh-btn-tb34 {
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    white-space: nowrap;
}

.sj-clear-btn-tb34:hover,
.sj-refresh-btn-tb34:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.sj-btn-clicked-tb34 {
    transform: scale(0.95) !important;
}

/* Loading Indicator */
.sj-table-loading-tb34 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    color: #1565c0;
    font-size: 16px;
    font-weight: 500;
}

.sj-loading-spinner-tb34 {
    width: 24px;
    height: 24px;
    border: 3px solid #e3f2fd;
    border-top: 3px solid #1565c0;
    border-radius: 50%;
    animation: spin-tb34 1s linear infinite;
}

@keyframes spin-tb34 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Wrapper */
.sj-table-wrapper-tb34 {
    overflow-x: auto;
    background: white;
}

/* Table Styles */
.sj-employees-table-tb34 {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.sj-table-header-tb34 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.sj-table-header-tb34 th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #1565c0;
    position: relative;
    white-space: nowrap;
}

.sj-table-header-tb34 th span {
    margin-right: 8px;
}

/* Sort Buttons */
.sj-sort-btn-tb34 {
    background: none;
    border: none;
    color: #1565c0;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.sj-sort-btn-tb34:hover {
    background: rgba(21, 101, 192, 0.1);
    transform: scale(1.1);
}

.sj-sort-btn-tb34.sj-active-sort-tb34 {
    background: #ff9800;
    color: white;
    font-weight: bold;
}

.sj-sort-icon-tb34 {
    font-size: 12px;
    display: inline-block;
}

/* Table Body */
.sj-table-row-tb34 {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.sj-table-row-tb34:hover {
    background: linear-gradient(135deg, #f8fafe 0%, #e3f2fd 100%);
    transform: translateX(2px);
    box-shadow: 2px 0 8px rgba(21, 101, 192, 0.1);
}

.sj-table-row-tb34 td {
    padding: 14px 12px;
    vertical-align: middle;
}

.sj-cell-content-tb34 {
    display: block;
    color: #333;
    font-weight: 500;
}

/* Department Badge */
.sj-dept-badge-tb34 {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.2);
}

/* Date Content */
.sj-date-content-tb34 {
    color: #1565c0;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Actions Column */
.sj-th-actions-tb34 {
    width: 120px;
    text-align: center;
}

.sj-td-actions-tb34 {
    text-align: center;
    padding: 8px !important;
}

.sj-action-buttons-tb34 {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* Action Buttons */
.sj-edit-btn-tb34,
.sj-delete-btn-tb34 {
    padding: 8px 10px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.sj-edit-btn-tb34 {
    color: #1565c0;
    border-color: #1565c0;
}

.sj-edit-btn-tb34:hover {
    background: #1565c0;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.sj-delete-btn-tb34 {
    color: #e53935;
    border-color: #e53935;
}

.sj-delete-btn-tb34:hover {
    background: #e53935;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.sj-edit-icon-tb34,
.sj-delete-icon-tb34 {
    display: block;
    line-height: 1;
}

/* Modal Styles */
.sj-modal-tb34 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.sj-modal-overlay-tb34 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.sj-modal-content-tb34 {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn-tb34 0.3s ease-out;
}

@keyframes modalSlideIn-tb34 {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.sj-modal-header-tb34 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e3f2fd;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.sj-modal-header-tb34 h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sj-modal-close-tb34 {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sj-modal-close-tb34:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.sj-modal-body-tb34 {
    padding: 25px;
}

.sj-modal-warning-tb34 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sj-warning-icon-tb34 {
    font-size: 24px;
    flex-shrink: 0;
}

.sj-modal-warning-tb34 p {
    margin: 0;
    color: #e65100;
    font-weight: 600;
    font-size: 16px;
}

/* Employee Details */
.sj-emp-details-tb34 {
    background: #f8fafe;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sj-detail-row-tb34 {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.sj-detail-row-tb34:last-child {
    border-bottom: none;
}

.sj-detail-row-tb34 strong {
    color: #1565c0;
    font-weight: 600;
    min-width: 120px;
}

.sj-detail-row-tb34 span {
    color: #333;
    font-weight: 500;
    text-align: right;
}

/* Modal Note */
.sj-modal-note-tb34 {
    padding: 15px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 2px solid #f44336;
    border-radius: 8px;
    text-align: center;
}

.sj-modal-note-tb34 p {
    margin: 0;
    color: #c62828;
    font-weight: 600;
    font-size: 14px;
}

/* Modal Footer */
.sj-modal-footer-tb34 {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-top: 2px solid #e3f2fd;
    background: #f8fafe;
    border-radius: 0 0 12px 12px;
}

.sj-modal-cancel-tb34,
.sj-modal-confirm-tb34 {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.sj-modal-cancel-tb34 {
    background: white;
    color: #666;
    border-color: #ccc;
}

.sj-modal-cancel-tb34:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: translateY(-1px);
}

.sj-modal-confirm-tb34 {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: white;
    border-color: #e53935;
}

.sj-modal-confirm-tb34:hover:not(:disabled) {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.sj-modal-confirm-tb34:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Delete Loading Spinner */
.sj-delete-loading-tb34 {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Animation class for delete spinner */
.sj-delete-loading-tb34.sj-spinning-tb34 {
    animation: spin-tb34 1s linear infinite;
}

/* Button loading state (ไม่มี animation) */
.sj-modal-confirm-tb34.sj-btn-loading-state-tb34 {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

/* Table Messages */
.sj-table-message-tb34 {
    margin: 15px 25px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn-tb34 0.3s ease-out;
}

.sj-table-success-tb34 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.sj-table-error-tb34 {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

.sj-table-info-tb34 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 2px solid #2196f3;
}

/* Form Highlight Effect */
.sj-highlight-form {
    animation: highlightPulse-tb34 2s ease-in-out;
}

@keyframes highlightPulse-tb34 {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(21, 101, 192, 0.1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(255, 152, 0, 0.3);
        transform: scale(1.02);
    }
}

/* No Data Message */
.sj-no-data-tb34 {
    text-align: center;
    padding: 60px 20px;
    background: white;
    color: #666;
}

.sj-no-data-icon-tb34 {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.sj-no-data-tb34 h3 {
    color: #1565c0;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.sj-no-data-tb34 p {
    margin: 0;
    font-size: 14px;
}

/* Pagination */
.sj-pagination-tb34 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 15px;
}

.sj-pagination-info-tb34 {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.sj-pagination-controls-tb34 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sj-page-btn-tb34 {
    padding: 8px 16px;
    border: 2px solid #1565c0;
    border-radius: 6px;
    background: white;
    color: #1565c0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sj-page-btn-tb34:hover:not(:disabled) {
    background: #1565c0;
    color: white;
    transform: translateY(-1px);
}

.sj-page-btn-tb34:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

/* Page Numbers */
.sj-page-numbers-tb34 {
    display: flex;
    gap: 5px;
    align-items: center;
}

.sj-page-num-tb34 {
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    background: white;
    color: #1565c0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.sj-page-num-tb34:hover {
    background: #e3f2fd;
    border-color: #1565c0;
}

.sj-page-num-tb34.sj-page-active-tb34 {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-color: #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.sj-page-ellipsis-tb34 {
    color: #666;
    padding: 8px 4px;
    font-weight: bold;
}

/* Error Message */
.sj-table-error-tb34 {
    padding: 15px 20px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
    border-radius: 8px;
    margin: 15px 25px;
    font-weight: 500;
    animation: slideIn-tb34 0.3s ease-out;
}

@keyframes slideIn-tb34 {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.sj-table-container-tb34.sj-loading-tb34 {
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sj-table-filters-tb34 {
        flex-direction: column;
        gap: 20px;
    }
    
    .sj-filter-group-tb34 {
        min-width: 100%;
    }
    
    .sj-filter-actions-tb34 {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sj-table-container-tb34 {
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .sj-table-filters-tb34 {
        padding: 20px 15px;
    }
    
    .sj-filter-actions-tb34 {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .sj-clear-btn-tb34,
    .sj-refresh-btn-tb34 {
        width: 100%;
    }
    
    .sj-employees-table-tb34 {
        font-size: 13px;
    }
    
    .sj-table-header-tb34 th,
    .sj-table-row-tb34 td {
        padding: 12px 8px;
    }
    
    .sj-pagination-tb34 {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .sj-pagination-controls-tb34 {
        width: 100%;
        justify-content: center;
    }
    
    .sj-page-numbers-tb34 {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* Stack table for very small screens */
    .sj-table-wrapper-tb34 {
        display: block;
    }
    
    .sj-employees-table-tb34,
    .sj-table-header-tb34,
    .sj-table-row-tb34,
    .sj-table-header-tb34 th,
    .sj-table-row-tb34 td {
        display: block;
    }
    
    .sj-table-header-tb34 {
        display: none;
    }
    
    .sj-table-row-tb34 {
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        background: white;
    }
    
    .sj-table-row-tb34 td {
        border: none;
        padding: 8px 0;
        position: relative;
        padding-left: 120px;
    }
    
    .sj-table-row-tb34 td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 110px;
        font-weight: 600;
        color: #1565c0;
        font-size: 12px;
        text-transform: uppercase;
    }
    
    /* Add data-labels for mobile */
    .sj-td-code-tb34:before { content: "รหัสพนักงาน:"; }
    .sj-td-name-tb34:before { content: "ชื่อ-นามสกุล:"; }
    .sj-td-dept-tb34:before { content: "แผนก:"; }
    .sj-td-date-tb34:before { content: "วันที่เริ่มงาน:"; }
    .sj-td-actions-tb34:before { content: "จัดการ:"; }
    
    /* Mobile actions layout */
    .sj-td-actions-tb34 {
        text-align: left !important;
    }
    
    .sj-action-buttons-tb34 {
        justify-content: flex-start;
        margin-top: 5px;
    }
}

/* Modal Responsive */
@media (max-width: 600px) {
    .sj-modal-tb34 {
        padding: 10px;
    }
    
    .sj-modal-content-tb34 {
        max-width: 100%;
        margin: 0;
        border-radius: 8px;
    }
    
    .sj-modal-header-tb34,
    .sj-modal-body-tb34,
    .sj-modal-footer-tb34 {
        padding: 15px 20px;
    }
    
    .sj-modal-footer-tb34 {
        flex-direction: column;
        gap: 10px;
    }
    
    .sj-modal-cancel-tb34,
    .sj-modal-confirm-tb34 {
        width: 100%;
    }
    
    .sj-detail-row-tb34 {
        flex-direction: column;
        gap: 5px;
        text-align: left;
    }
    
    .sj-detail-row-tb34 strong {
        min-width: auto;
    }
    
    .sj-detail-row-tb34 span {
        text-align: left;
        font-size: 16px;
        padding-left: 10px;
    }
}


/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .sj-table-row-tb34,
    .sj-sort-btn-tb34,
    .sj-page-btn-tb34,
    .sj-page-num-tb34,
    .sj-filter-input-tb34,
    .sj-filter-select-tb34 {
        transition: none;
        animation: none;
    }
    
    .sj-loading-spinner-tb34 {
        animation: none;
        border: 3px solid #1565c0;
    }
}

/* Focus visible for keyboard navigation */
.sj-filter-input-tb34:focus-visible,
.sj-filter-select-tb34:focus-visible,
.sj-clear-btn-tb34:focus-visible,
.sj-refresh-btn-tb34:focus-visible,
.sj-sort-btn-tb34:focus-visible,
.sj-page-btn-tb34:focus-visible,
.sj-page-num-tb34:focus-visible {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sj-table-container-tb34,
    .sj-employees-table-tb34,
    .sj-table-row-tb34 {
        border-width: 2px;
    }
    
    .sj-filter-input-tb34,
    .sj-filter-select-tb34 {
        border-width: 2px;
    }
}