* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    /*justify-content: center;
    gap: 15px;
    margin-bottom: 10px;*/
    font-weight: 700;
    color: #1a237e;
    transition: opacity 0.3s;
}

.logo:hover {
  opacity: 0.9;
}

.logo-icon {
  margin-right: 12px;
  color: #1a237e;
}

.logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1a237e 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo i {
    font-size: 3rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* Search Container */
.search-container {
    padding: 40px;
    background: #f8f9fa;
}

.search-box {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

#searchInput {
    flex: 1;
    padding: 20px 25px;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchButton {
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

#searchButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.examples {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.example-tag {
    display: inline-block;
    background: white;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.example-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Results */
.results-container {
    padding: 0 40px 40px;
}

.results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h2 {
    color: #333;
    margin-bottom: 10px;
}

#resultsCount {
    color: #666;
    font-size: 1.1rem;
}

.results {
    min-height: 400px;
}

.result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.result-title {
    color: #1a237e;
    font-size: 1.3rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-snippet {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.9rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.welcome-message h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #555;
}

.feature i {
    color: #667eea;
}

/* Chat Bot Section */
.chat-bot-section {
    background: #1a237e;
    color: white;
    padding: 30px;
    margin: 40px;
    border-radius: 15px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.chat-header i {
    font-size: 2rem;
}

.chat-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    max-width: 80%;
}

.bot-message {
    background: #f0f0f0;
    color: #333;
    align-self: flex-start;
}

.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.chat-input {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

#chatButton {
    padding: 15px 25px;
    background: #00c853;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

.hostinger-note {
    margin: 10px 0;
    color: #333;
    font-weight: 500;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links span {
    color: #999;
}

/* Infinite Scroll Styles */
.load-more-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.load-more-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.load-more-button:active {
    transform: translateY(0);
}

.load-more-button i {
    margin-right: 8px;
}

.load-more-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #667eea;
}

.load-more-error {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
}

.load-more-error p {
    margin-bottom: 10px;
}

.load-more-error button {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.load-more-error button:hover {
    background: #5a6fd8;
}

.result-timestamp {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

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

/* Responsive */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
    
    #searchButton {
        width: 100%;
        justify-content: center;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header, .search-container, .results-container {
        padding: 20px;
    }
    
    .chat-bot-section {
        margin: 20px;
    }
    .load-more-button {
        padding: 12px;
        font-size: 0.9rem;
    }
    /* On mobile, show the load more button more prominently */
    .load-more-button {
        position: sticky;
        bottom: 20px;
        margin: 20px auto;
        max-width: 90%;
        z-index: 10;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

/* Animation for new results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

/* Stagger the animations for new results */
.result-item:nth-child(n) {
    animation-delay: calc(0.05s * var(--animation-order));
}

/* Scroll progress indicator (optional) */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 1000;
    transition: width 0.1s;
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    color: #f0f0f0;
}

body.dark-mode .container {
    background: #2d3748;
    color: #f0f0f0;
}

body.dark-mode .result-item {
    background: #4a5568;
    border-color: #5a6575;
    color: #f0f0f0;
}

body.dark-mode .result-title {
    color: #90cdf4;
}

body.dark-mode .search-suggestions {
    background: #4a5568;
    border-color: #5a6575;
}

body.dark-mode .search-suggestions .suggestion-item:hover {
    background: #5a6575;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    background: #667eea;
    color: white;
    transform: rotate(30deg);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: -1px; /* Overlap the border */
}

.search-suggestions .suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    color: #333;
    font-size: 1rem;
}

.search-suggestions .suggestion-item:hover {
    background: #f8f9fa;
}

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

body.dark-mode .search-suggestions {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .search-suggestions .suggestion-item {
    color: #f0f0f0;
    border-bottom: 1px solid #4a5568;
}

body.dark-mode .search-suggestions .suggestion-item:hover {
    background: #4a5568;
}

/* Quick Facts */
.quick-facts {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 10px 0;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
}

.fact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.fact-item i {
    color: #667eea;
}

.fact-item a {
    color: #667eea;
    text-decoration: none;
}

.fact-item a:hover {
    text-decoration: underline;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.share-btn {
    padding: 8px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.share-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Attribution Footer */
.attribution {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

.attribution a {
    color: #667eea;
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

/* Featured Articles */
.featured-section {
    margin: 40px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border-radius: 15px;
}

.featured-header {
    text-align: center;
    margin-bottom: 20px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.featured-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.featured-item:hover {
    transform: translateY(-5px);
}

/* Wikipedia Compliance Banner */
.compliance-banner {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #666;
}

.compliance-banner a {
    color: #1a237e;
    font-weight: 500;
}

/* Add these styles to your existing CSS */

/* Load More Button */
.load-more-button {
    display: none; /* Hidden by default */
    width: 100%;
    max-width: 300px;
    margin: 40px auto;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.load-more-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.load-more-button:active:not(:disabled) {
    transform: translateY(0);
}

.load-more-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.load-more-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.load-more-button:hover::after {
    left: 100%;
}

/* Loading Container */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.error-icon {
    font-size: 3rem;
    color: #dc2626;
    margin-bottom: 20px;
}

.retry-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Result Stats */
.result-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-stat i {
    font-size: 0.8rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.share-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.share-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Dark Mode Adjustments */
body.dark-mode .load-more-button {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

body.dark-mode .share-btn {
    background: #4a5568;
    border-color: #5a6575;
    color: #f0f0f0;
}

body.dark-mode .share-btn:hover {
    background: #667eea;
    border-color: #667eea;
}

body.dark-mode .result-stats {
    color: #a0aec0;
}

body.dark-mode .share-buttons {
    border-top-color: #4a5568;
}

/* Scroll to Top Button */
.scroll-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    transition: all 0.3s;
}

.scroll-top-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.scroll-top-button.visible {
    display: flex;
}

/* Search Suggestions Improvements */
.search-suggestions {
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

body.dark-mode .suggestion-item:hover {
    background: #4a5568;
}

/* Footer Improvements */
footer {
    position: relative;
    z-index: 10;
    background: #f8f9fa;
    margin-top: 60px;
}

body.dark-mode footer {
    background: #2d3748;
}

/* Animation for new results */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: slideInUp 0.4s ease-out;
    animation-fill-mode: both;
}

/* Stagger animations */
.result-item:nth-child(odd) {
    animation-delay: 0.05s;
}

.result-item:nth-child(even) {
    animation-delay: 0.1s;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .load-more-button {
        max-width: 90%;
        padding: 16px 25px;
        font-size: 1rem;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    .scroll-top-button {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .load-more-button {
        padding: 14px 20px;
    }
    
    .share-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}