/* Enhanced Department Management CSS */

/* Bulk Operations Styling */
.bulk-operations {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(0, 121, 90, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.bulk-operations .btn {
    transition: all 0.3s ease;
}

.bulk-operations .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Department Selection Checkboxes */
.department-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    margin-right: 0.5rem;
}

.department-checkbox:checked {
    background: var(--primary-color);
}

/* Advanced Search Highlighting */
mark {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Enhanced Department Tree */
.department-tree {
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.department-tree::-webkit-scrollbar {
    width: 6px;
}

.department-tree::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.department-tree::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.department-tree::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Department Node Animations */
.department-node {
    transition: all 0.3s ease;
}

.department-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.department-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.department-item:hover::before {
    left: 100%;
}

.department-children {
    transition: all 0.3s ease;
    border-left: 2px solid rgba(79, 70, 229, 0.3);
    position: relative;
}

.department-children::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.department-children:hover::before {
    opacity: 1;
}

/* Enhanced Status Badges */
.status-badge {
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.3s ease;
}

.status-badge:hover::before {
    left: 100%;
}

/* Enhanced Notification System */
.notification-banner {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-banner.show {
    animation: slideInRight 0.3s ease;
}

.notification-banner button {
    transition: all 0.2s ease;
}

.notification-banner button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Enhanced Modal Animations */
.modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    animation: slideInUp 0.3s ease;
    transform-origin: center bottom;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced Form Styling */
.form-group {
    position: relative;
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    transform: translateY(-25px) scale(0.875);
    color: var(--primary-color);
}

.form-label {
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding: 1rem 0.75rem 0.5rem;
}

.form-floating .form-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    padding: 0 0.25rem;
}

/* Enhanced Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Enhanced Table Styling */
.departments-table tr {
    transition: all 0.3s ease;
}

.departments-table tr:hover {
    background: rgba(79, 70, 229, 0.05);
    transform: scale(1.002);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.departments-table th {
    position: relative;
    cursor: pointer;
}

.departments-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.departments-table th:hover::after {
    width: 100%;
}

/* Enhanced Action Buttons */
.action-buttons {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.departments-table tr:hover .action-buttons {
    opacity: 1;
}

.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.2;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.action-btn:hover::before {
    width: 100%;
    height: 100%;
}

/* Enhanced Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-value {
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.05);
    color: var(--primary-color);
}

/* Enhanced Search Input */
.search-container {
    overflow: hidden;
}

.search-input {
    position: relative;
    z-index: 1;
}

.search-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.search-input:focus + .search-icon ~ *::after,
.search-container:focus-within::after {
    width: 100%;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    border-width: 3px;
    border-style: solid;
    border-color: var(--primary-color) transparent var(--primary-color) transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Department Analytics */
.analytics-chart {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-muted);
}

/* Enhanced Progress Bars */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .department-tree {
        max-height: 50vh;
    }
    
    .bulk-operations {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bulk-operations > div {
        flex-direction: column;
        align-items: stretch;
    }
    
    .notification-banner {
        max-width: 90%;
        margin: 0 5%;
    }
    
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .form-control {
        color-scheme: dark;
    }
    
    .search-input {
        color-scheme: dark;
    }
    
    .filter-select {
        color-scheme: dark;
    }
}

/* Print Styles */
@media print {
    .admin-actions,
    .control-panel,
    .bulk-operations,
    .action-buttons {
        display: none !important;
    }
    
    .departments-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .stat-card {
        border: 1px solid #000;
        box-shadow: none;
    }
}