/* Custom styles for Juvo Labs Advisor */

/* Dark mode improvements */
@media (prefers-color-scheme: dark) {
    .dark\:bg-gray-900 {
        background-color: #111827;
    }
    
    .dark\:bg-gray-800 {
        background-color: #1f2937;
    }
    
    .dark\:bg-gray-700 {
        background-color: #374151;
    }
    
    .dark\:text-white {
        color: #ffffff;
    }
    
    .dark\:text-gray-300 {
        color: #d1d5db;
    }
    
    .dark\:text-gray-400 {
        color: #9ca3af;
    }
}

/* Custom scrollbar */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark .overflow-y-auto::-webkit-scrollbar-track {
    background: #374151;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message animations */
.message-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* File upload drag and drop */
.border-dashed {
    border-style: dashed;
}

#dropZone.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.dark #dropZone.drag-over {
    background-color: #1e3a8a;
}

/* Button hover effects */
.transform {
    transition: transform 0.2s ease-in-out;
}

.hover\:scale-105:hover {
    transform: scale(1.05);
}

/* Loading spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Responsive text */
@media (max-width: 768px) {
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .text-3xl {
        font-size: 1.875rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
}

/* Chat input auto-resize */
textarea {
    min-height: 2.5rem;
    max-height: 8rem;
    resize: none;
    overflow-y: auto;
}

/* Info panel scrollbar */
#infoPanel::-webkit-scrollbar {
    width: 6px;
}

#infoPanel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

#infoPanel::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #cbd5e1, #94a3b8);
    border-radius: 3px;
    transition: background 0.3s;
}

#infoPanel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #94a3b8, #64748b);
}

.dark #infoPanel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark #infoPanel::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #6b7280, #4b5563);
}

.dark #infoPanel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #4b5563, #374151);
}

/* Enhanced info panel animations */
#infoPanelContainer {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#infoPanelContainer.w-0 {
    width: 0;
}

#infoPanelContainer .bg-gradient-to-r {
    transition: all 0.3s ease;
}

#infoPanelContainer .bg-gradient-to-r:hover {
    transform: translateY(-2px);
}

/* Info panel card shadows */
.info-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Staggered animation for info sections */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-section-animate {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Pulse animation for new data */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse-once {
    animation: pulse 1s ease-in-out;
}

/* Focus states */
.focus\:ring-2:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Custom alert styles */
.alert {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* File type icons */
.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
}

/* Conversation list hover */
.conversation-item:hover {
    background-color: #f8fafc;
}

.dark .conversation-item:hover {
    background-color: #374151;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Utility classes */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.break-words {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Responsive info panel */
@media (max-width: 1024px) {
    #infoPanelContainer {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        z-index: 40;
    }
    
    #infoPanelContainer.w-96 {
        width: 100%;
        max-width: 24rem;
    }
}

@media (max-width: 768px) {
    #infoPanelContainer.w-96 {
        width: 100%;
        max-width: 100%;
    }
}

/* Badge animations */
.badge-pulse {
    position: relative;
}

.badge-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 9999px;
    background: currentColor;
    opacity: 0.3;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Responsive grid improvements */
@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
