/* ============================================
   Trợ Lý Funedu - Main Stylesheet
   Giữ nguyên 100% giao diện React gốc
   ============================================ */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Markdown Styles */
.prose h1 {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #1e293b;
}

.prose h2 {
    font-size: 1.25em;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #334155;
}

.prose h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose p {
    margin-bottom: 0.8em;
    line-height: 1.7;
}

.prose strong {
    font-weight: 600;
    color: #0f172a;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.prose th,
.prose td {
    border: 1px solid #e2e8f0;
    padding: 0.75em;
    text-align: left;
}

.prose th {
    background-color: #f8fafc;
    font-weight: 600;
}

.prose blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    font-style: italic;
    background: #f0f9ff;
    margin: 1em 0;
    border-radius: 0 8px 8px 0;
}

.prose code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

/* Dark Mode Markdown */
.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose strong {
    color: #f1f5f9;
}

.dark .prose p,
.dark .prose ul,
.dark .prose ol,
.dark .prose li {
    color: #cbd5e1;
}

.dark .prose th,
.dark .prose td {
    border-color: #334155;
    color: #e2e8f0;
}

.dark .prose th {
    background-color: #1e293b;
}

.dark .prose blockquote {
    border-left-color: #60a5fa;
    background: #1e293b;
    color: #94a3b8;
}

.dark .prose code {
    background: #1e293b;
    color: #e2e8f0;
}

.dark .katex {
    color: #e2e8f0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Tool Card Hover Effect */
.tool-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Category Buttons */
.category-btn {
    transition: all 0.3s ease;
}

.category-btn:hover {
    opacity: 1;
    transform: scale(1.02);
}

.category-btn.active {
    ring: 2px;
    ring-offset: 2px;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.dark .form-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .form-input:focus {
    background: #1e293b;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* File Drop Zone */
.drop-zone {
    border: 2px dashed #cbd5e1;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.drop-zone.has-file {
    border-style: solid;
    border-color: #22c55e;
    background: #f0fdf4;
}

.dark .drop-zone {
    border-color: #475569;
}

.dark .drop-zone:hover,
.dark .drop-zone.dragover {
    border-color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom scrollbar for sidebar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Tooltip */
.tooltip {
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}

.group:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Audio Player */
audio {
    width: 100%;
    border-radius: 8px;
}

audio::-webkit-media-controls-panel {
    background: #f1f5f9;
}

.dark audio::-webkit-media-controls-panel {
    background: #1e293b;
}