/* Global Styles */
:root {
    --primary-color: #5E3AE4;
    --secondary-color: #1A1AFF;
    --accent-color: #CF88FF;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --dark-color: #1A1A1A;
    --light-color: #F7F7F7;
    --border-color: #E0E0E0;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.period-selector label {
    font-weight: 600;
    color: #333;
}

.period-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.period-dropdown:focus {
    outline: none;
    border-color: #5E3AE4;
    box-shadow: 0 0 0 2px rgba(94, 58, 228, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.logo {
    height: 32px;
}

header h1 {
    flex: 1;
    margin-left: 20px;
    font-size: 24px;
    color: var(--dark-color);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #4A2FBF;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light-color);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

/* Department Tabs */
.department-tabs {
    margin: 30px 0 0 0;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding: 0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.tab-btn {
    padding: 14px 28px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    margin-bottom: -2px;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.tab-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.tab-btn:focus:not(:focus-visible) {
    outline: none;
}

.tab-btn .badge {
    background-color: #e0e0e0;
    color: #666;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

.tab-btn.active .badge {
    background-color: var(--primary-color);
    color: white;
}

/* Custom scrollbar for tabs */
.department-tabs::-webkit-scrollbar {
    height: 6px;
}

.department-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.department-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.department-tabs::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive tabs */
@media (max-width: 768px) {
    .department-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 8px;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        flex-shrink: 0;
    }
}

.tab-skeleton {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 6px;
}

/* Reports Section */
.reports-section {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-top: -2px;
}

.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.report-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.report-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.report-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.report-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.score-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.score-bar {
    flex: 1;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-small {
    max-width: 500px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}



/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-overlay h3 {
    color: white;
    margin: 20px 0 10px;
    font-size: 24px;
}

.progress-container {
    margin: 30px auto;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

#progressText {
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
    color: white;
}

.progress-details {
    margin-top: 20px;
}

.progress-details p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

/* Report Insights Styles */
.report-insights {
    margin-top: 20px;
}

.report-insights h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-color);
}

.insight-item p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

/* Report Content Styles */
.report-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

.report-section {
    margin-bottom: 35px;
}

.report-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.report-section h4 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

/* List styles for report content */
.report-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-section li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding-right: 15px;
}

.report-section li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    font-size: 20px;
    position: absolute;
    left: 10px;
    top: 10px;
}

/* Separate competency name from description */
.report-section li strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

/* Report info styles */
.report-content p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-content p strong {
    min-width: 120px;
    color: #666;
    font-weight: 500;
}

.competency-chart {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.competency-name {
    flex: 0 0 200px;
    font-weight: 500;
}

.competency-bars {
    flex: 1;
}

.competency-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.bar-label {
    font-size: 12px;
    color: #666;
    width: 80px;
}

.bar-track {
    flex: 1;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.bar-fill.self {
    background-color: var(--success-color);
}

.bar-fill.team-lead {
    background-color: var(--primary-color);
}

.bar-fill.others {
    background-color: var(--dark-color);
}

.bar-value {
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

/* Animations */
@keyframes loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    header h1 {
        margin-left: 0;
        text-align: center;
    }
    
    .reports-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .competency-chart {
        flex-direction: column;
        align-items: stretch;
    }
    
    .competency-name {
        flex: none;
    }
}