/* Employee Performance Dashboard - Professional Styles */

/* CSS Variables for Easy Customization */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #111827;
    --light-bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Container */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: "📊";
    font-size: 1.8rem;
}

/* File Upload Styles */
.file-upload {
    position: relative;
}

#csvFileInput {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    border: none;
    font-size: 1rem;
}

.upload-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-btn::before {
    content: "📁";
}

/* Search Styles */
.employee-search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#employeeSearchInput {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 300px;
    transition: all 0.3s ease;
    background: white;
}

#employeeSearchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#searchEmployeeBtn {
    padding: 0.75rem 1.5rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    font-size: 1rem;
}

#searchEmployeeBtn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    padding: 2rem 0;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar h3 {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

#departmentList {
    list-style: none;
}

#departmentList li {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#departmentList li:hover {
    background: var(--light-bg);
    border-left-color: var(--primary-color);
}

#departmentList li.active {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Quick Stats */
.stat-card {
    background: var(--light-bg);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Main Content */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--light-bg);
}

section {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Employee Details */
.employee-details {
    max-width: 1200px;
    margin: 0 auto;
}

.detail-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.detail-item strong {
    color: var(--text-secondary);
    display: inline-block;
    min-width: 200px;
}

/* Performance Bar */
.performance-bar {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    color: white;
    font-weight: 600;
    margin-left: 1rem;
    min-width: 60px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: growWidth 1s ease-out;
}

/* Performance Summary Card */
.performance-summary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

/* Competency Charts Container */
.competency-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.competency-chart, .competency-heatmap {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

.competency-chart h3, .competency-heatmap h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.competency-chart canvas {
    max-width: 100%;
    height: 350px !important;
}

/* Heat Map Styles */
.competency-heatmap {
    display: flex;
    flex-direction: column;
    max-height: 500px;
    overflow-y: auto;
}

.competency-heatmap > div:not(:first-child) {
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 0.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.competency-heatmap > div:not(:first-child):hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.competency-heatmap small {
    opacity: 0.9;
    font-size: 0.75rem;
}

/* Department Cards */
.dept-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.dept-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.dept-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Button Styles */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes growWidth {
    from {
        width: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .competency-charts {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .employee-search {
        width: 100%;
    }
    
    #employeeSearchInput {
        flex: 1;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .content {
        padding: 1rem;
    }
    
    .competency-charts {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar, header, .file-upload, .employee-search {
        display: none !important;
    }
    
    .content {
        padding: 0 !important;
    }
    
    .dashboard-container {
        display: block !important;
    }
    
    section {
        box-shadow: none;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .notification {
        display: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
