/* HR & H&S Document Manager - Admin Styles */
/* Matches WATS styling for consistency */

.hr-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.hr-type-badge.hr {
    background: #28a745;
    color: white;
}

.hr-type-badge.hs {
    background: #dc3545;
    color: white;
}

.hr-type-badge.general {
    background: #6c757d;
    color: white;
}

.approval-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.approval-status.pending {
    background: #ffc107;
    color: #212529;
}

.approval-status.approved {
    background: #28a745;
    color: white;
}

.approval-status.rejected {
    background: #dc3545;
    color: white;
}

.approval-status.na {
    background: #e9ecef;
    color: #6c757d;
}

.download-count {
    font-weight: bold;
    color: #007cba;
}

/* Group assignment meta box styling */
.hr-hs-group-assignment {
    max-height: 200px;
    overflow-y: auto;
}

.hr-hs-group-assignment p {
    margin: 5px 0;
}

.hr-hs-group-assignment label {
    font-weight: normal;
    margin-left: 5px;
}

.hr-hs-group-assignment small {
    display: block;
    margin-left: 20px;
    color: #666;
    font-style: italic;
}

/* Admin pages styling */
.hr-hs-admin-page {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.13);
    margin: 20px 0;
    padding: 20px;
}

.hr-hs-stats-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.hr-hs-stat-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
}

.hr-hs-stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #007cba;
    display: block;
}

.hr-hs-stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Upload area styling */
.hr-hs-upload-zone {
    border: 2px dashed #007cba;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.hr-hs-upload-zone:hover,
.hr-hs-upload-zone.dragover {
    border-color: #005a87;
    background: #e3f2fd;
}

.hr-hs-upload-zone .upload-icon {
    font-size: 48px;
    color: #007cba;
    margin-bottom: 15px;
}

.hr-hs-upload-zone .upload-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.hr-hs-upload-zone .upload-hint {
    color: #666;
    font-size: 14px;
}

/* Document grid styling */
.hr-hs-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.hr-hs-document-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hr-hs-document-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.hr-hs-document-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #dee2e6;
}

.hr-hs-document-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
}

.hr-hs-document-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.hr-hs-document-actions {
    text-align: right;
    margin-top: 15px;
}

.hr-hs-document-actions .button {
    margin-left: 5px;
}

/* Form styling to match WATS */
.hr-hs-form-table {
    width: 100%;
    border-collapse: collapse;
}

.hr-hs-form-table th {
    width: 150px;
    text-align: left;
    padding: 15px 10px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.hr-hs-form-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.hr-hs-form-table input,
.hr-hs-form-table select,
.hr-hs-form-table textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
}

.hr-hs-form-table input:focus,
.hr-hs-form-table select:focus,
.hr-hs-form-table textarea:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Business groups checkbox grid */
.hr-hs-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.hr-hs-groups-grid label {
    display: block;
    padding: 5px;
    font-weight: normal;
}

.hr-hs-groups-grid input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

/* Progress bar styling */
.hr-hs-progress {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.hr-hs-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #005a87);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.hr-hs-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Alert styling */
.hr-hs-alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid;
}

.hr-hs-alert.success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.hr-hs-alert.error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.hr-hs-alert.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.hr-hs-alert.info {
    background: #cce7ff;
    border-left-color: #007bff;
    color: #004085;
}

/* Responsive design */
@media (max-width: 768px) {
    .hr-hs-stats-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hr-hs-documents-grid {
        grid-template-columns: 1fr;
    }
    
    .hr-hs-form-table th,
    .hr-hs-form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .hr-hs-form-table input,
    .hr-hs-form-table select,
    .hr-hs-form-table textarea {
        max-width: 100%;
    }
    
    .hr-hs-groups-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading spinner */
.hr-hs-loading {
    text-align: center;
    padding: 40px;
}

.hr-hs-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: hr-hs-spin 1s linear infinite;
}

@keyframes hr-hs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip styling */
.hr-hs-tooltip {
    position: relative;
    cursor: help;
}

.hr-hs-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 1;
}

.hr-hs-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(1px);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Button styling to match WordPress/WATS */
.hr-hs-button {
    background: #007cba;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.hr-hs-button:hover {
    background: #005a87;
    color: white;
}

.hr-hs-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hr-hs-button.secondary {
    background: #f7f7f7;
    color: #555;
    border: 1px solid #ccc;
}

.hr-hs-button.secondary:hover {
    background: #fafafa;
    border-color: #999;
}

.hr-hs-button.danger {
    background: #dc3545;
}

.hr-hs-button.danger:hover {
    background: #c82333;
}

/* Custom thumbnail preview in media library */
.hr-hs-custom-thumbnail {
    position: relative;
}

.hr-hs-custom-thumbnail::after {
    content: "Generated";
    position: absolute;
    top: 5px;
    right: 5px;
    background: #007cba;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
}

/* Integration with WordPress admin */
.hr-hs-admin-notice {
    background: white;
    border-left: 4px solid #007cba;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin: 5px 15px 2px;
    padding: 1px 12px;
}

.hr-hs-admin-notice p {
    margin: .5em 0;
    padding: 2px;
}

/* Fix for WordPress admin menu icon */
#adminmenu #toplevel_page_hr-hs-document-manager .wp-menu-image {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgMkMzIDEuNDQ3NzIgMy40NDc3MiAxIDQgMUgxNkMxNi41NTIzIDEgMTcgMS40NDc3MiAxNyAyVjE4QzE3IDE4LjU1MjMgMTYuNTUyMyAxOSAxNiAxOUg0QzMuNDQ3NzIgMTkgMyAxOC41NTIzIDMgMThWMloiIGZpbGw9IiM5Q0E2QUYiLz4KPHBhdGggZD0iTTUgNUg3VjdINVY1WiIgZmlsbD0iIzNCODJGNiIvPgo8cGF0aCBkPSJNOSA1SDEzVjZIOVY1WiIgZmlsbD0iIzNiODJmNiIvPgo8cGF0aCBkPSJNNSA5SDdWMTFINVY5WiIgZmlsbD0iI0RDMzU0NSIvPgo8cGF0aCBkPSJNOSA5SDEzVjEwSDlWOVoiIGZpbGw9IiNkYzM1NDUiLz4KPHBhdGggZD0iTTUgMTNIN1YxNUg1VjEzWiIgZmlsbD0iIzlDQTZBRiIvPgo8cGF0aCBkPSJNOSAxM0gxM1YxNEg5VjEzWiIgZmlsbD0iIzljYTZhZiIvPgo8L3N2Zz4K');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

#adminmenu #toplevel_page_hr-hs-document-manager:hover .wp-menu-image,
#adminmenu #toplevel_page_hr-hs-document-manager.wp-has-current-submenu .wp-menu-image {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgMkMzIDEuNDQ3NzIgMy40NDc3MiAxIDQgMUgxNkMxNi41NTIzIDEgMTcgMS40NDc3MiAxNyAyVjE4QzE3IDE4LjU1MjMgMTYuNTUyMyAxOSAxNiAxOUg0QzMuNDQ3NzIgMTkgMyAxOC41NTIzIDMgMThWMloiIGZpbGw9IiNGRkZGRkYiLz4KPHBhdGggZD0iTTUgNUg3VjdINVY1WiIgZmlsbD0iIzAwN0NCQSIvPgo8cGF0aCBkPSJNOSA1SDEzVjZIOVY1WiIgZmlsbD0iIzAwN2NiYSIvPgo8cGF0aCBkPSJNNSA5SDdWMTFINVY5WiIgZmlsbD0iI0RDMzU0NSIvPgo8cGF0aCBkPSJNOSA5SDEzVjEwSDlWOVoiIGZpbGw9IiNkYzM1NDUiLz4KUGF0aCBkPSJNNSAxM0g3VjE1SDVWMTNaIiBmaWxsPSIjMDA3Q0JBIi8+CjxwYXRoIGQ9Ik05IDEzSDEzVjE0SDlWMTNaIiBmaWxsPSIjMDA3Y2JhIi8+Cjwvc3ZnPgo=');
}

/* Additional library-specific styles */
.hr-hs-fade-in {
    animation: hrHsFadeIn 0.5s ease-in-out;
}

@keyframes hrHsFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced document cards for library view */
.hr-hs-library-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hr-hs-library-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.hr-hs-library-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hr-hs-library-card:hover::before {
    opacity: 1;
}

/* Priority indicators */
.hr-hs-priority-high {
    border-left: 4px solid #ffc107;
}

.hr-hs-priority-critical {
    border-left: 4px solid #dc3545;
}

/* Enhanced search and filter area */
.hr-hs-search-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.hr-hs-search-container:focus-within {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

/* Category badges */
.hr-hs-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2px;
}

/* Download count styling */
.hr-hs-download-badge {
    background: #28a745;
    color: white;
    border-radius: 15px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* File type icons */
.hr-hs-file-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 8px;
}

.hr-hs-file-icon.pdf {
    background: #dc3545;
}

.hr-hs-file-icon.doc,
.hr-hs-file-icon.docx {
    background: #0d6efd;
}

.hr-hs-file-icon.xls,
.hr-hs-file-icon.xlsx {
    background: #198754;
}

.hr-hs-file-icon.ppt,
.hr-hs-file-icon.pptx {
    background: #fd7e14;
}

/* Improved responsive behavior */
@media (max-width: 992px) {
    .hr-hs-documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hr-hs-library-container {
        padding: 10px;
    }
    
    .hr-hs-search-container {
        padding: 20px;
    }
    
    .hr-hs-filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hr-hs-library-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .hr-hs-library-title {
        font-size: 1.8rem;
    }
}

/* Custom scrollbar for filter areas */
.hr-hs-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.hr-hs-scroll-area::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.hr-hs-scroll-area::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.hr-hs-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Enhanced button styles */
.hr-hs-btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hr-hs-btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.hr-hs-btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.hr-hs-btn-gradient:hover::before {
    left: 100%;
}

/* Status indicators */
.hr-hs-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.hr-hs-status-indicator.active {
    background: #28a745;
}

.hr-hs-status-indicator.pending {
    background: #ffc107;
}

.hr-hs-status-indicator.expired {
    background: #dc3545;
}
