Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@
rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<link href="faq.css" rel="stylesheet" />
<style>
/* FAQ Search Enhancements */
.faq-item.hidden {
display: none;
}

.faq-highlight {
background: #ffeb3b;
color: #000;
padding: 2px 4px;
border-radius: 4px;
}
/* FAQ No Results Message */
.faq-no-results {
text-align: center;
padding: 40px 20px;
color: var(--text-muted, #aaa);
font-size: 1.1rem;
}

.faq-no-results i {
font-size: 2rem;
margin-bottom: 10px;
display: block;
opacity: 0.7;
}

</style>
</head>

<body>
Expand Down Expand Up @@ -110,6 +138,10 @@ <h1 class="serif">Frequently Asked Questions</h1>

<!-- FAQ Container -->
<div class="faq-container">
<div id="faqNoResults" class="faq-no-results" style="display: none;">
<i class="fas fa-search"></i>
<p>No matching FAQs found. Try different keywords.</p>
</div>

<!-- Getting Started Section -->
<div class="faq-section">
Expand Down Expand Up @@ -668,6 +700,89 @@ <h4 class="serif">Smart Tools</h4>
}
});
</script>
<script>
/* =========================
FAQ SEARCH FUNCTIONALITY
========================= */

function clearHighlights(element) {
element.innerHTML = element.innerHTML.replace(
/<span class="faq-highlight">(.*?)<\/span>/g,
"$1"
);
}

function highlightText(element, query) {
const regex = new RegExp(`(${query})`, "gi");
element.innerHTML = element.textContent.replace(
regex,
`<span class="faq-highlight">$1</span>`
);
}

function handleSearch(query) {
const searchTerm = query.trim().toLowerCase();
const faqItems = document.querySelectorAll(".faq-item");
const noResultsEl = document.getElementById("faqNoResults");

let matches = [];

faqItems.forEach(item => {
const questionEl = item.querySelector(".faq-question h3");
const answerEl = item.querySelector(".faq-answer-content");

// Clear old highlights
clearHighlights(questionEl);
clearHighlights(answerEl);

const qText = questionEl.textContent.toLowerCase();
const aText = answerEl.textContent.toLowerCase();

if (searchTerm === "") {
item.classList.remove("hidden");
item.classList.remove("active");
if (noResultsEl) noResultsEl.style.display = "none";
return;
}

if (qText.includes(searchTerm) || aText.includes(searchTerm)) {
item.classList.remove("hidden");
item.classList.add("active");

highlightText(questionEl, searchTerm);
highlightText(answerEl, searchTerm);

matches.push(item);
} else {
item.classList.add("hidden");
item.classList.remove("active");
}
});

// Bring matches to top of their section
matches.forEach(item => {
const section = item.closest(".faq-section");
section.appendChild(item);
});

// Show No Results message
if (noResultsEl) {
noResultsEl.style.display = matches.length === 0 && searchTerm !== ""
? "block"
: "none";
}

// Scroll to first match
if (matches.length > 0) {
matches[0].scrollIntoView({
behavior: "smooth",
block: "center"
});
}
}

</script>

<script src="auth.js"></script>
</body>

Expand Down
170 changes: 169 additions & 1 deletion terms-and-service.css
Original file line number Diff line number Diff line change
Expand Up @@ -776,4 +776,172 @@ body {
transform: translate(-50%, -50%) scale(1.8);
background-color: #22c55e; /* Changes to AgriTech green on hover */
box-shadow: 0 0 20px #22c55e;
}
}/* ================================
NAVBAR ALIGNMENT FIX
================================ */

.navbar {
width: 100%;
position: sticky;
top: 0;
z-index: 999;
}

.navbar-content {
display: flex;
align-items: center; /* βœ… Vertical alignment */
justify-content: space-between;
gap: 16px;
padding: 12px 24px;
}

/* Brand (Logo / Site Name) */
.navbar .brand {
display: flex;
align-items: center;
}

/* Spacer should actually flex */
.navbar-spacer {
flex: 1;
}

/* Right side buttons */
.nav-buttons {
display: flex;
align-items: center; /* βœ… Align buttons vertically */
gap: 10px; /* βœ… Consistent spacing */
}

/* Buttons & links inside navbar */
.nav-buttons .btn {
display: inline-flex;
align-items: center;
justify-content: center;
white-space: nowrap;
}

/* Theme toggle alignment */
.theme-toggle {
display: inline-flex;
align-items: center;
gap: 6px;
}

/* Prevent wrapping on desktop */
@media (min-width: 768px) {
.navbar-content {
flex-wrap: nowrap;
}
}
/* ============================
NAVBAR SPACING & ALIGNMENT
============================ */

.navbar {
padding: 12px 0; /* Vertical breathing space */
}

.navbar-content {
max-width: 1200px; /* Center + consistent width */
margin: 0 auto;
padding: 0 24px; /* Left/right spacing */
display: flex;
align-items: center;
gap: 24px; /* Space between brand & buttons */
}

/* Brand/logo spacing */
.navbar .brand {
display: flex;
align-items: center;
gap: 10px;
}

.navbar .logo {
font-size: 1.4rem;
letter-spacing: 0.5px;
}

/* Spacer should actually push buttons right */
.navbar-spacer {
flex: 1;
}

/* Buttons container spacing */
.nav-buttons {
display: flex;
align-items: center;
gap: 12px; /* Space between buttons */
}

/* Button consistency */
.nav-buttons .btn {
padding: 8px 16px;
border-radius: 8px;
font-size: 0.9rem;
line-height: 1;
white-space: nowrap;
}

/* Theme toggle tighter + aligned */
.theme-toggle {
display: flex;
align-items: center;
gap: 6px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
.navbar-content {
padding: 0 16px;
gap: 12px;
}

.nav-buttons {
gap: 8px;
}

.navbar .logo {
font-size: 1.2rem;
}
}
/* =========================================
EXTREME LEFT LOGO + EXTREME RIGHT BUTTONS
========================================= */

.navbar-content {
max-width: 100% !important; /* Allow full width */
width: 100%;
padding: 0 32px; /* Edge spacing */
display: flex;
align-items: center;
}

/* Force brand to extreme left */
.navbar .brand {
margin-right: auto; /* Push everything else right */
}

/* Kill spacer impact just in case */
.navbar-spacer {
display: none !important;
}

/* Force buttons to extreme right */
.nav-buttons {
margin-left: auto;
display: flex;
align-items: center;
gap: 12px;
}

/* Optional polish */
.navbar {
padding: 12px 0;
}

.navbar .logo {
font-size: 1.4rem;
letter-spacing: 0.5px;
}
Loading