/* Main Styles for SLR Platform */

/* Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Global Styles */
body {
    font-family: var(--font-family);
    background-color: #f8f9fa;
    color: var(--dark-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,.05);
    padding-top: 1rem;
}

.sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--light-color);
}

.sidebar .nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 1.5rem;
    margin-right: 0.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border-color: #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.form-floating > label {
    color: #6c757d;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--light-color);
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: var(--dark-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}

/* Badges */
.badge {
    padding: 0.375em 0.75em;
    font-weight: 500;
}

/* Progress */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Project Status */
.project-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
}

.status-planning { 
    background-color: #e3f2fd; 
    color: #1976d2; 
}

.status-searching { 
    background-color: #f3e5f5; 
    color: #7b1fa2; 
}

.status-screening { 
    background-color: #fff3e0; 
    color: #f57c00; 
}

.status-extraction { 
    background-color: #e8f5e9; 
    color: #388e3c; 
}

.status-synthesis { 
    background-color: #e0f2f1; 
    color: #00796b; 
}

.status-completed { 
    background-color: #f5f5f5; 
    color: #616161; 
}

/* Paper Cards */
.paper-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.paper-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

/* Decision Buttons */
.decision-button {
    width: 100px;
    margin: 0.25rem;
}

/* Quality Badges */
.quality-badge {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.quality-high { 
    background-color: #d4edda; 
    color: #155724; 
}

.quality-medium { 
    background-color: #fff3cd; 
    color: #856404; 
}

.quality-low { 
    background-color: #f8d7da; 
    color: #721c24; 
}

/* Activity Timeline */
.activity-item {
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    border: 2px solid white;
}

/* PRISMA Diagram */
.prisma-box {
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 300px;
    text-align: center;
    background-color: white;
}

.prisma-arrow {
    text-align: center;
    margin: 1rem 0;
    font-size: 2rem;
    color: var(--primary-color);
}

/* Screening Interface */
.screening-paper {
    max-height: 600px;
    overflow-y: auto;
}

.screening-decisions {
    position: sticky;
    top: 20px;
}

/* Data Extraction Form */
.extraction-field {
    margin-bottom: 1.5rem;
}

.extraction-field label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Forest Plot */
.forest-plot-container {
    overflow-x: auto;
    padding: 1rem;
}

/* Evidence Map */
.evidence-map-cell {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.evidence-map-cell:hover {
    background-color: #f8f9fa;
}

.evidence-map-cell.has-evidence {
    background-color: #e3f2fd;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #f3f3f3;
    border-top: 0.25em solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content-wrapper {
        margin-left: 0;
    }
}

/* Print Styles */
@media print {
    .navbar, .sidebar, .btn, .form-control {
        display: none !important;
    }
    
    .content-wrapper {
        margin: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Utilities */
.text-truncate-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.text-truncate-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.border-start-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-start-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-start-danger {
    border-left: 4px solid var(--danger-color) !important;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}