/* Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Reduce reflows by using transform instead of changing layout properties */
.card, .stat-card, .topic-card, .btn {
    will-change: transform;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand i {
    color: var(--info-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Processing Steps */
.processing-step {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.processing-step:last-child {
    border-bottom: none;
}

.processing-step .step-icon {
    width: 24px;
    text-align: center;
}

.processing-step .step-text {
    font-weight: 500;
}

.processing-step .step-details {
    margin-left: 26px;
}

.processing-step .step-details .progress {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Forms */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin Dashboard */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin: 0;
    font-weight: 300;
}

/* Topic Cards */
.topic-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.topic-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.topic-card .topic-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.topic-card .topic-description {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.topic-card .topic-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
}

.topic-card .topic-stats span {
    color: var(--secondary-color);
}

.topic-card .topic-stats strong {
    color: var(--dark-color);
}

/* Document List */
.document-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.document-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.document-item .document-icon {
    font-size: 2rem;
    color: var(--danger-color);
    margin-right: 15px;
}

.document-item .document-info {
    flex: 1;
}

.document-item .document-name {
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.document-item .document-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.document-item .document-status {
    margin-left: 10px;
}

.document-item .badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: var(--light-color);
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: white;
}

.upload-zone.dragover {
    border-color: var(--success-color);
    background: #e8f5e9;
}

.upload-zone .upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.upload-zone .upload-text {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* Loading Spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Login Page */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.login-card .login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.google-login-btn {
    background: white;
    border: 1px solid #dadce0;
    color: #3c4043;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.3s;
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-login-btn img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 15px;
    }
    
    .dashboard-header {
        padding: 20px 0;
    }
    
    .topic-card .topic-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .document-item .document-status {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Footer */
.footer {
    background: var(--light-color);
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}