/* Employee Document Manager Styles - Compatible with Uncode Theme */

.employee-manager-container,
.employee-documents-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Action Buttons */
.action-buttons {
    margin-bottom: 30px;
    text-align: center;
}

.action-buttons .btn {
    margin: 0 10px 10px 0;
}

/* Ensure buttons are visible and clickable */
#toggle-add-employee,
#toggle-upload-document {
    display: inline-block !important;
    visibility: visible !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

#toggle-add-employee:hover,
#toggle-upload-document:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.employee-form-section,
.document-form-section,
.employee-list-section,
.document-list-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.employee-form-section h3,
.document-form-section h3,
.employee-list-section h3,
.document-list-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Form Styles */
.uncode-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.uncode-form-row input[type="text"],
.uncode-form-row input[type="email"],
.uncode-form-row input[type="password"],
.uncode-form-row input[type="file"],
.uncode-form-row select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.uncode-form-row input:focus,
.uncode-form-row select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-default {
    background-color: #007cba;
    color: white;
}

.btn-default:hover {
    background-color: #005a87;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    color: white;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    color: white;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    color: white;
}

.btn.edm-btn-view,
.btn.edm-btn-edit,
.btn.edm-btn-delete {
    padding: 6px 20px !important; 
}

/* Custom padding for View PDF button */
.document-actions .btn-default {
    padding: 6px 20px !important;
}

/* Desktop Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* UPDATED: Consistent hover behavior for all data tables */
.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Desktop actions - keep inline */
.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    margin-right: 8px;
    margin-bottom: 4px;
    display: inline-block;
}

.table-actions .btn:last-child {
    margin-right: 0;
}

/* Modal Styles */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background-color: rgba(0,0,0,0.5) !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    position: relative !important;
    background-color: #fff !important;
    padding: 30px !important;
    border-radius: 8px !important;
    width: 90% !important;
    max-width: 600px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    margin: 0 !important;
}

.close {
    position: absolute !important;
    right: 15px !important;
    top: 10px !important;
    font-size: 28px !important;
    font-weight: bold !important;
    color: #aaa !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.close:hover {
    color: #000 !important;
}

/* Hide navigation when modal is open */
body.modal-open .menu-wrapper {
    display: none !important;
}

body.modal-open {
    overflow: hidden !important;
}

.modal[style*="display: none"] {
    display: none !important;
}

/* Document Styles */
.documents-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.document-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.document-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.document-item.read {
    border-left: 4px solid #159bd7;
    background-color: #f0f8ff;
}

.document-item.unread {
    border-left: 4px solid #ffc107;
    background-color: #fffdf5;
}

.document-info h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.document-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.read-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.read-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.read-status {
    color: #159bd7;
    font-weight: 600;
    font-size: 14px;
}

/* Employee Detail View */
.employee-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.employee-detail-row:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.employee-detail-row strong {
    color: #333;
    font-weight: 600;
    min-width: 80px;
}

.employee-detail-row span {
    color: #666;
    flex: 1;
    text-align: right;
}

/* Document Status Display */
.employee-documents-read {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.employee-documents-read h4 {
    color: #333;
    margin-bottom: 15px;
}

.document-status-section {
    margin-bottom: 25px;
}

.document-status-section h5 {
    margin: 0 0 15px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-section {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.category-section h6 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #007cba;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}

.read-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background-color: #f8fff9;
    border-left: 3px solid #28a745;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.read-status-item:hover {
    background-color: #f0fff0;
    transform: translateX(2px);
}

.unread-status-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background-color: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.unread-status-item:hover {
    background-color: #fff0f0;
    transform: translateX(2px);
}

.document-title {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.read-date {
    color: #666;
    font-size: 12px;
    background-color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin-left: 10px;
}

.unread-badge {
    color: #dc3545;
    font-size: 11px;
    background-color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #dc3545;
    white-space: nowrap;
    margin-left: 10px;
}

#employee-view-read-status {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0;
    background-color: #fff;
}

#employee-view-read-status .document-status-section:last-child {
    margin-bottom: 0;
}

/* File Upload Styling */
input[type="file"] {
    padding: 10px !important;
    border: 2px dashed #ddd !important;
    background-color: #f9f9f9;
}

input[type="file"]:hover {
    border-color: #007cba !important;
    background-color: #f0f8ff;
}

/* Login Required Message */
.login-required-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.login-required-message p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

.login-required-message p:last-child {
    margin-bottom: 0;
}

/* Success/Error Messages */
.message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar styling */
#employee-view-read-status::-webkit-scrollbar {
    width: 6px;
}

#employee-view-read-status::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#employee-view-read-status::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#employee-view-read-status::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .uncode-form-row {
        flex-direction: column;
    }
    
    .uncode-form-row input,
    .uncode-form-row select {
        min-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .action-buttons {
        text-align: center;
    }
    
    .action-buttons .btn {
        display: block;
        width: 80%;
        max-width: 300px;
        margin: 0 auto 15px auto;
    }
    
    .document-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .employee-list-section,
    .document-list-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .employee-list-section h3,
    .document-list-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    /* Convert tables to cards on mobile */
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: block;
    }
    
    .data-table tr {
        display: block;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        position: relative;
        transition: all 0.3s ease;
    }
    
    /* Mobile hover effect for cards */
    .data-table tr:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .data-table td {
        display: block;
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .data-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
    }
    
    /* Add labels before each data cell */
    .employee-table td:nth-child(1):before { content: "Name: "; }
    .employee-table td:nth-child(2):before { content: "Email: "; }
    .employee-table td:nth-child(3):before { content: "Username: "; }
    .employee-table td:nth-child(4):before { content: "Actions"; }
    
    .document-table td:nth-child(1):before { content: "Title: "; }
    .document-table td:nth-child(2):before { content: "Category: "; }
    .document-table td:nth-child(3):before { content: "Upload Date: "; }
    .document-table td:nth-child(4):before { content: "Actions"; }
    
    /* Style the labels */
    .data-table td:before {
        display: block;
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        font-size: 12px;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }
    
    /* Actions column specific styling for mobile */
    .table-actions:before {
        content: "Actions";
        display: block !important;
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        font-size: 12px;
        margin-bottom: 10px;
        letter-spacing: 0.5px;
    }
    
    /* Mobile actions - override desktop inline styling */
    .table-actions {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        justify-content: flex-start;
        white-space: normal !important;
        padding-left: 0 !important;
        padding-top: 10px;
    }
    
    .table-actions .btn {
        flex: none !important;
        width: 100% !important;
        min-width: auto !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        padding: 12px 16px !important;
        text-align: center !important;
        margin: 0 !important;
        display: block !important;
        border-radius: 6px;
    }
    
    /* Adjust content spacing for non-action cells */
    .data-table td:not(.table-actions) {
        padding-left: 0;
        margin-left: 0;
    }
    
    /* Style data content */
    .data-table td:not(.table-actions):after {
        content: attr(data-content);
        display: block;
        color: #333;
        font-size: 14px;
        font-weight: normal;
        margin-top: 2px;
        line-height: 1.4;
    }
    
    .read-status-item,
    .unread-status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .read-date,
    .unread-badge {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .category-section {
        padding: 8px;
    }
    
    .document-status-section h5 {
        font-size: 14px;
        padding: 6px 8px;
    }
}