/* NextBus.lk - Main Stylesheet */

/* Alpine.js x-cloak directive - prevents flash of unstyled content */
[x-cloak] {
    display: none !important;
}

/* Custom styles beyond Tailwind */
.route-stop-dot {
    position: relative;
}

.route-stop-dot::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #3b82f6;
}

.route-stop-line {
    position: absolute;
    left: -15.5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
}

/* Language-specific styles */
[lang="si"] {
    font-family: 'Noto Sans Sinhala', sans-serif;
}

[lang="ta"] {
    font-family: 'Noto Sans Tamil', sans-serif;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .route-list-header {
        display: none;
    }
    
    .route-list-item {
        flex-direction: column;
        padding: 12px 0;
    }
    
    .route-list-item > div {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Animation for location sharing */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.location-pulse {
    animation: pulse 2s infinite;
}

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

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

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Autocomplete Suggestions Styling */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 12rem;
    overflow-y: auto;
    z-index: 50;
}

.suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease-in-out;
}

.suggestion-item:hover,
.suggestion-item.bg-blue-100 {
    background-color: #dbeafe;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Ensure parent containers have relative positioning */
.search-input-container {
    position: relative;
}

/* Modal zoom-safe fixes */
.modal-container {
    width: min(90vw, 896px) !important;
    height: min(80vh, 600px) !important;
    max-width: none !important;
    max-height: none !important;
}

/* Modal and Enhanced Features (moved from HTML template) */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.bus-detail-hidden {
  display: none;
}

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

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

.route-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.amenity-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Minimal typography for article content (when Tailwind Typography is not present) */
.prose {
    color: #1f2937; /* gray-800 */
    font-size: 1.125rem; /* 18px base for readability */
    line-height: 1.75;    /* comfortable line-height */
}
.prose h1 {
    font-size: 2rem; /* slightly larger */
    line-height: 2.4rem;
    font-weight: 700;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}
.prose h2 {
    font-size: 1.625rem;
    line-height: 2.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.prose h3 {
    font-size: 1.25rem;
    line-height: 1.8rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.prose p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}
.prose ul,
.prose ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose a {
    color: #2563eb; /* blue-600 */
    text-decoration: underline;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.prose table th,
.prose table td {
    border: 1px solid #e5e7eb; /* gray-200 */
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    color: #4b5563; /* gray-600 */
}
/* Media queries to improve larger screens */
@media (min-width: 1024px) {
  .prose {
    font-size: 1.125rem;
    line-height: 1.85;
  }
  .prose h1 { font-size: 2.25rem; line-height: 2.6rem; }
  .prose h2 { font-size: 1.75rem; line-height: 2.2rem; }
}