/* Custom CSS for Smart Research Assistant */

:root {
    --primary-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --secondary-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --error-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Font Family */
.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Glass morphism effects */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Gradient text */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button styles */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Progress steps */
.progress-step {
    animation: fadeInUp 0.5s ease-out;
}

.progress-step.active .step-icon {
    background: var(--primary-gradient);
    color: white;
    animation: pulse 2s infinite;
}

.progress-step.completed .step-icon {
    background: var(--success-gradient);
    color: white;
}

.progress-step.active .step-text {
    color: #1f2937;
    font-weight: 600;
}

.progress-step.completed .step-text {
    color: #059669;
}

/* File upload styles */
.file-upload-zone {
    transition: all 0.3s ease;
}

.file-upload-zone:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
}

.file-upload-zone.dragover {
    background-color: #eff6ff;
    border-color: #2563eb;
    transform: scale(1.02);
}

/* Uploaded file item */
.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    animation: slideInRight 0.3s ease-out;
}

.uploaded-file .file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.uploaded-file .file-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
}

.uploaded-file .remove-file {
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.uploaded-file .remove-file:hover {
    background-color: #fee2e2;
}

/* Research results styles */
.research-result {
    animation: fadeInUp 0.6s ease-out;
}

.result-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.result-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.citation {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.citation-source {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.citation-source:hover {
    text-decoration: underline;
}

/* Dashboard styles */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #6b7280;
    font-weight: 500;
    margin-top: 8px;
}

/* Query history */
.query-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.query-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.query-timestamp {
    color: #9ca3af;
    font-size: 0.875rem;
}

.query-text {
    color: #374151;
    margin: 8px 0;
}

.query-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.query-status.completed {
    background-color: #d1fae5;
    color: #065f46;
}

.query-status.processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.query-status.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

.loading-dots {
    display: inline-flex;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: #3b82f6;
    border-radius: 50%;
    margin: 0 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.1s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.2s;
}

/* Progress bar animations */
.progress-bar {
    background: var(--primary-gradient);
    height: 100%;
    border-radius: inherit;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .progress-sidebar {
        display: none !important;
    }
    
    .result-content {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(17, 24, 39, 0.7);
        --glass-border: rgba(75, 85, 99, 0.2);
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .progress-sidebar,
    nav,
    .btn-primary {
        display: none !important;
    }
    
    .research-result {
        break-inside: avoid;
    }
}