/* AgrinFinance Custom Styles */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Global transitions */
*, *::before, *::after { transition-property: color, background-color, border-color, box-shadow, opacity, transform; transition-duration: 150ms; transition-timing-function: ease; }

/* Navbar scroll shadow */
#navbar.scrolled { box-shadow: 0 4px 24px -4px rgba(0,0,0,0.10); }

/* Institution card hover lift */
.group:hover { transform: translateY(-2px); }

/* AI Review HTML content styling */
.ai-review-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}
.ai-review-content h2:first-child { border-top: none; margin-top: 0; }
.ai-review-content p { margin-bottom: 0.875rem; line-height: 1.75; color: #475569; }
.ai-review-content strong { color: #1e293b; }
.ai-review-content ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 0.875rem; }
.ai-review-content ul li { color: #475569; margin-bottom: 0.25rem; }

/* Prose overrides */
.prose h2 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.prose p  { color: #475569; line-height: 1.75; margin-bottom: 1rem; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Tailwind line-clamp fallback */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 20px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: 0.3s; }
input:checked + .toggle-slider { background: #f59e0b; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Loading spinner */
.spinner { border: 3px solid #e2e8f0; border-top-color: #f59e0b; border-radius: 50%; width: 20px; height: 20px; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Star animation on hover */
.star-rating:hover svg { color: #fbbf24; }

/* Card shimmer loading */
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Announcement bar dismiss */
#topBar { transition: height 0.3s, opacity 0.3s; }

/* Focus visible ring */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Responsive table */
@media (max-width: 768px) {
    .overflow-x-auto { -webkit-overflow-scrolling: touch; }
}

/* Print styles */
@media print {
    #topBar, header, footer, nav, .no-print { display: none !important; }
}
