<?php session_start(); include 'db.php'; // Latest reviews $latestReviews = $pdo->query(" SELECT r.comment, r.rating, u.username, c.name AS company_name FROM reviews r JOIN users u ON r.user_id = u.id JOIN companies c ON r.company_id = c.id ORDER BY r.id DESC LIMIT 5 ")->fetchAll(); // Top rated companies $topCompanies = $pdo->query(" SELECT c.id, c.name, c.image, ROUND(AVG(r.rating),1) AS avg_rating FROM companies c JOIN reviews r ON c.id = r.company_id GROUP BY c.id HAVING COUNT(r.id) >= 1 ORDER BY avg_rating DESC LIMIT 5 ")->fetchAll(); // Latest blog posts (limit 5 for sidebar) $latestBlogs = $pdo->query(" SELECT id, title FROM blogs ORDER BY created_at DESC LIMIT 5 ")->fetchAll(); // Fetch testimonials from users table $testimonials = $pdo->query(" SELECT username, testimonial FROM users WHERE testimonial IS NOT NULL AND testimonial != '' ORDER BY id DESC LIMIT 10 ")->fetchAll(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>About Us | Learn More About Review Stream</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet"> <!-- Sans-serif fonts --> <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Raleway&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap" rel="stylesheet"> <!-- Favicon --> <link rel="icon" href="/favicon.png" type="image/png" /> <style> body { margin: 0px; font-family: 'Roboto', sans-serif; line-height: 1.6; padding-bottom: 260px !important; } .banner { background: url('images/about/banner1.jpg') no-repeat center center; background-size: cover; color: white; text-align: center; padding: 80px 20px; } .banner h1 { font-size: 3em; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); } .hero-img { width: 100%; height: 300px; object-fit: cover; border-radius: 8px; margin: 20px 0; } .content-layout { display: flex; gap: 40px; /* increased gap */ flex-wrap: wrap; } .main-content { flex: 3; min-width: 250px; } .sidebar { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 15px; } .main-content .card { background: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: box-shadow 0.3s ease; } .main-content .card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.15); } .main-content h2, .main-content h3 { color: #4A90E2; margin-top: 15px; margin-bottom: 10px; } .main-content p, .main-content ul { font-size: 1.05em; color: #444; } .main-content ul li { margin-bottom: 6px; } @media (max-width: 768px) { .main-content, .sidebar { width: 100% !important; /* take full width on mobile */ float: none !important; /* stop floating side-by-side */ display: block; /* stack them vertically */ } } /* --- SIDEBAR --- */ .sidebar { display: flex; flex-direction: column; gap: 20px; } .sidebar-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.07); transition: box-shadow 0.3s ease; } .sidebar-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.15); } /* Optional dark mode support */ body.dark-mode .sidebar-card { background: #1e1e1e; } /* --- TESTIMONIAL SLIDER --- */ .slider-wrapper { position: relative; margin-top: 20px; } .slider-container { display: flex; overflow-x: auto; scroll-behavior: smooth; gap: 16px; padding-bottom: 5px; } .slider-card { flex: 0 0 auto; background: linear-gradient(145deg, #ffffff, #f0f0f0); border-radius: 12px; padding: 18px; width: 240px; box-shadow: 0 3px 8px rgba(0,0,0,0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; } .slider-card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); } .slider-card p { font-size: 0.95em; color: #333; } .testimonial-tag { font-size: 0.8em; color: #666; } /* --- SLIDER ARROWS --- */ .slider-arrow { background: rgba(0,0,0,0.5); color: white; width: 32px; height: 32px; font-size: 1em; border: none; cursor: pointer; border-radius: 50%; transition: background 0.3s; } .slider-arrow:hover { background: rgba(0,0,0,0.7); } .slider-arrow.left { left: -12px; } .slider-arrow.right { right: -12px; } /* --- BUTTON --- */ .btn-primary { display: inline-block; background: #4A90E2; color: white; padding: 10px 18px; border-radius: 6px; text-decoration: none; margin-top: 10px; transition: background 0.3s ease; } .btn-primary:hover { background: #4A90E2; } /* --- MISSION, VALUES, WHY CHOOSE, CTA SECTIONS --- */ .mission, .values, .why-choose, .cta { background: #f9f9f9; border: 1px solid #e6e6e6; border-radius: 10px; padding: 20px; margin-top: 20px; } .mission h3, .values h3, .why-choose h3, .cta h3 { color: #4A90E2; font-weight: 600; } /* --- DARK MODE SUPPORT (optional) --- */ body.dark-mode { background: #121212; color: #e0e0e0; } body.dark-mode .main-content .card, body.dark-mode .sidebar, body.dark-mode .mission, body.dark-mode .values, body.dark-mode .why-choose, body.dark-mode .cta { background: #1e1e1e; color: #e0e0e0; } body.dark-mode .slider-card { background: #2c2c2c; color: #ddd; } body.dark-mode .slider-arrow { background: rgba(255,255,255,0.2); } /* --- CONTAINER SPACING --- */ .container { max-width: 1200px; margin: auto; padding: 20px; } .star-box { display: inline-block; width: 20px; height: 20px; margin-right: 2px; text-align: center; line-height: 20px; border-radius: 3px; } .star-box.filled { background: #00b67a; color: white; } .star-box.empty { background: #d3d3d3; color: white; } /* Collapsible menu */ .menu { display: none; flex-direction: column; } .menu.active { display: flex; } .menu a { padding: 8px 0; text-decoration: none; color: #333; } .menu-toggle { font-size: 1.5em; cursor: pointer; } @media(min-width: 768px){ .menu { display: flex !important; flex-direction: row; } .menu a { margin-left: 15px; } .menu-toggle { display: none; } } .about-flex { max-width: 1000px; margin: 0 auto; padding: 20px; } .about-img { float: left; width: 400px; height: 450px; object-fit: cover; margin-right: 20px; /* space between image and text */ border-radius: 8px; /* optional */ } @media (max-width: 768px) { .about-img { float: none; width: 100% !important; height: auto !important; margin: 0 0 15px 0; display: block; } } .about-text { flex: 1; min-width: 250px; /* ensure text doesn't get too narrow on small screens */ } .about-text p { text-align: justify; /* makes text flow neatly under the image */ overflow: hidden; /* ensure container wraps around floated image */ } .fixed-footer { position: fixed; left: 0; bottom: 0; width: 100%; background: #222; text-align: center; padding: 10px 0; color: #fff; z-index: 1000; } .fixed-footer p{ font-family: 'Poppins', sans-serif !important; font-size: 13px !important; } .f