/* --- Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', sans-serif; /* Body font */
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif; /* Headings font */
    color: #1a2a43; /* Dark blue from your logo */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Consistent padding on sides */
}

/* --- Header & Navigation --- */
header {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    z-index: 100; /* Ensure header is on top */
    position: relative;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 55px; /* Adjust size to fit your design */
    width: auto;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* Align items vertically in nav */
}

.main-nav ul li {
    margin-left: 30px; /* Space between nav items */
}

.main-nav .nav-link {
    text-decoration: none;
    color: #555; /* Neutral grey for regular links */
    font-family: 'Poppins', sans-serif; /* Use heading font for nav links */
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    padding: 5px 0; /* Add padding for hover area */
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active { /* Add .active class for current page */
    color: #28a745; /* Vibrant green for hover */
}

/* Call-to-Action Button */
.cta-button {
    display: inline-block; /* Makes padding work like a button */
    background-color: #28a745; /* Vibrant green from your logo */
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px; /* Pill shape */
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2); /* Subtle shadow for depth */
}

.cta-button:hover {
    background-color: #1e7e34; /* Darker green on hover */
    transform: translateY(-2px); /* Slight lift effect */
}

/* --- Added Styles for Admin Panel Link and User Auth Status --- */
#admin-panel-link {
    display: none; /* Hidden by default, shown by JS if user is admin */
}

.user-auth-status {
    /* Styles for the container holding user display, login, and logout links */
    display: flex;
    align-items: center;
    gap: 10px; /* Space between user display and links */
    margin-left: 30px; /* Keep consistent spacing with other nav items */
}

#user-display {
    color: #1a2a43; /* Dark blue for user's email */
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
}

.auth-link {
    text-decoration: none;
    color: #007bff; /* A standard blue for login/logout links */
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #0056b3; /* Darker blue on hover */
}

/* --- Hero Section --- */
.hero {
    background-color: #e9ecef; /* Light gray background */
    padding: 100px 0; /* More vertical space */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero .container h1 {
    font-size: 3rem; /* Larger hero heading */
    color: #1a2a43; /* Dark blue */
    margin-bottom: 15px;
}

.hero .container p {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 40px;
}

/* Search bar styling (separate boxes) */
.search-bar {
    display: flex;
    justify-content: center; /* Center the items */
    max-width: 700px; /* Slightly wider search bar */
    margin: 0 auto;
    gap: 10px; /* Space between search elements */
}

.search-bar input {
    flex-grow: 1;
    padding: 15px 20px; /* More padding */
    border: 1px solid #ddd;
    border-radius: 8px; /* Rounded corners */
    font-size: 1.05rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* Inner shadow */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input:focus {
    border-color: #28a745; /* Green border on focus */
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2); /* Green glow on focus */
    outline: none;
}

.search-bar button {
    background-color: #1a2a43; /* Using dark blue for search button, contrasts nicely */
    color: #fff;
    border: none;
    padding: 15px 25px; /* More padding */
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-bar button:hover {
    background-color: #0d1a2c; /* Darker blue on hover */
    transform: translateY(-1px);
}

/* --- Sections (General Styling) --- */
section {
    padding: 60px 0;
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a2a43;
    margin-bottom: 40px;
    text-align: center;
}

/* --- Categories Section --- */
.categories {
    background-color: #fff; /* White background for this section */
}

/* Old .category-grid is now replaced by .category-dropdown-wrapper */
.category-dropdown-wrapper {
    max-width: 400px; /* Limit width of dropdown */
    margin: 0 auto;
    padding: 0 20px;
}

#categoryFilterDropdown {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    background-color: #f0f8ff; /* Light blue background for dropdown */
    color: #1a2a43;
    appearance: none; /* Remove default dropdown arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231a2a43%22%20d%3D%22M287%2C146.2L146.2%2C287c-4.7%2C4.7-12.3%2C4.7-17%2C0L5.4%2C146.2c-4.7-4.7-4.7-12.3%2C0-17l8.5-8.5c4.7-4.7%2C12.3-4.7%2C17%2C0l114.3%2C114.3l114.3-114.3c4.7-4.7%2C12.3-4.7%2C17%2C0l8.5%2C8.5C291.7%2C133.9%2C291.7%2C141.5%2C287%2C146.2z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#categoryFilterDropdown:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
    outline: none;
}


/* --- Business List (Home Page) --- */
.business-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.business-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.business-card .card-link {
    display: block; /* Make the whole card clickable */
    padding: 25px;
    text-decoration: none;
    color: inherit; /* Inherit text color */
}

.business-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #1a2a43;
}

.business-card p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 8px;
}

.business-card .read-more {
    display: inline-block;
    margin-top: 15px;
    color: #28a745;
    font-weight: 600;
    text-decoration: none;
}

/* --- Form Styles (for submit.html and parts of admin.html) --- */
.form-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin: 50px auto;
    max-width: 700px;
}

.form-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
}

.form-section p {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a2a43;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="password"], /* Added for auth forms */
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
    outline: none;
}

.form-section button[type="submit"],
.form-section button[type="button"] { /* Added for auth buttons */
    background-color: #1a2a43;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
}

.form-section button[type="submit"]:hover,
.form-section button[type="button"]:hover { /* Added for auth buttons */
    background-color: #0d1a2c;
    transform: translateY(-2px);
}

/* Specific styling for auth buttons to be side-by-side */
#auth-section button[type="button"] {
    display: inline-block; /* Make them sit next to each other */
    width: auto; /* Allow content to dictate width */
    margin: 10px 5px; /* Adjust margin for spacing */
    padding: 10px 20px; /* Slightly less padding than main submit button */
    font-size: 1rem;
}

/* Message styling */
.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    display: none; /* Hidden by default, shown by JS */
}

.message.info {
    background-color: #e7f3fe;
    color: #007bff;
    border: 1px solid #007bff;
}

.message.success {
    background-color: #d4edda;
    color: #28a745;
    border: 1px solid #28a745;
}

.message.warning {
    background-color: #fff3cd;
    color: #ffc107;
    border: 1px solid #ffc107;
}

.message.error {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #dc3545;
}


/* Switch auth mode link */
.switch-auth-mode {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555;
}

.switch-auth-mode a {
    color: #28a745; /* Green link */
    text-decoration: none;
    font-weight: 600;
}

.switch-auth-mode a:hover {
    text-decoration: underline;
}

/* Password toggle icon styling */
.password-input-container {
    position: relative; /* Needed for absolute positioning of the icon */
    margin-bottom: 15px; /* Adjust as needed for spacing */
}

.password-input-container input[type="password"],
.password-input-container input[type="text"] {
    width: calc(100% - 40px); /* Adjust width to make space for the icon */
    padding-right: 35px; /* Space for the icon */
    box-sizing: border-box; /* Include padding in width calculation */
}

.password-toggle-icon {
    position: absolute;
    right: 10px; /* Position from the right edge of the container */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for perfect vertical centering */
    cursor: pointer;
    color: #888; /* Icon color */
    font-size: 1rem; /* Icon size */
    transition: color 0.2s ease-in-out;
}

.password-toggle-icon:hover {
    color: #333; /* Darker color on hover */
}

/* Ensure labels for password field are still block-level or have appropriate display */
.password-input-container label {
    display: block; /* Ensures label is on its own line */
    margin-bottom: 5px; /* Space between label and input */
}


/* --- Admin Panel Styles (admin.html) --- */
#admin-dashboard {
    padding-top: 50px;
    display: none; /* Hidden by default until admin status is confirmed */
}

.admin-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.admin-section h2 {
    text-align: left; /* Align headings left in admin sections */
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.admin-business-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-business-item h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: #1a2a43;
}

.admin-business-item p {
    font-size: 0.9rem;
    color: #555;
}

/* Flexbox for admin action buttons */
.admin-actions {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 10px; /* Space between buttons */
    margin-top: 10px; /* Space from content */
}

.admin-business-item button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.admin-business-item .approve-btn {
    background-color: #28a745; /* Green */
    color: #fff;
}
.admin-business-item .approve-btn:hover {
    background-color: #1e7e34;
}

.admin-business-item .reject-btn {
    background-color: #dc3545; /* Red */
    color: #fff;
}
.admin-business-item .reject-btn:hover {
    background-color: #c82333;
}

.admin-business-item .revert-btn {
    background-color: #ffc107; /* Yellow/Orange */
    color: #333;
}
.admin-business-item .revert-btn:hover {
    background-color: #e0a800;
}

.admin-business-item .delete-btn {
    background-color: #6c757d; /* Grey */
    color: #fff;
}
.admin-business-item .delete-btn:hover {
    background-color: #545b62;
}

/* --- Business Detail Page Styles --- */
.business-detail-page {
    padding-top: 50px;
    padding-bottom: 50px;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Info on left, reviews on right (desktop) */
    gap: 40px;
}

.detail-card, .reviews-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.detail-card h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #1a2a43;
}

.detail-card p {
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #444;
}

.detail-card p strong {
    color: #1a2a43;
}

.detail-card a {
    color: #28a745;
    text-decoration: none;
}

.detail-card a:hover {
    text-decoration: underline;
}

/* Social links on detail page */
.social-links a {
    display: inline-block;
    margin-right: 15px; /* Space between social links */
    font-weight: 600;
    color: #007bff; /* Use a distinct color for social links */
}
.social-links a:hover {
    color: #0056b3;
}


/* Reviews Section */
.reviews-card h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #1a2a43;
}

.reviews-card h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1a2a43;
}

#review-auth-message {
    text-align: center;
    color: #dc3545; /* Red for warning */
    margin-bottom: 20px;
    font-weight: 600;
}

.review-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.review-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #28a745; /* Green for reviewer name/rating */
}

.review-item p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 5px;
}

.review-item small {
    font-size: 0.8rem;
    color: #888;
}

/* Review Form Styling (using existing .form-group) */
#review-form button {
    background-color: #1a2a43; /* Dark blue submit button */
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
}

#review-form button:hover {
    background-color: #0d1a2c;
    transform: translateY(-1px);
}


/* Star Rating Container for Review Form */
.star-rating-container {
    display: flex; /* Arrange stars in a row */
    font-size: 1.8rem; /* Size of the stars */
    color: #ccc; /* Default color for empty stars */
    margin-top: 5px;
    margin-bottom: 15px; /* Space below stars */
    cursor: pointer;
}

.star-rating-container i {
    padding: 0 3px; /* Small space between stars */
    transition: color 0.1s ease-in-out; /* Smooth color transition on hover/fill */
}

/* Color for filled stars (fa-solid) */
.star-rating-container i.fa-solid {
    color: #ffc107; /* Golden yellow for filled stars */
}

/* Specific styling for stars in review display (not interactive) */
.review-item h4 .filled-star,
.review-item h4 .empty-star {
    font-size: 1rem; /* Smaller stars for display in review items */
    margin-left: 5px; /* Space after "Rating: " */
}
.review-item h4 .filled-star {
    color: #ffc107; /* Consistent golden yellow */
}
.review-item h4 .empty-star {
    color: #ccc; /* Consistent grey for empty */
}


/* --- Footer --- */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero .container h1 {
        font-size: 2.5rem;
    }
    .hero .container p {
        font-size: 1.1rem;
    }
    .business-detail-page {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul {
        margin-top: 15px;
        flex-direction: column; /* Stack nav items */
        width: 100%;
        align-items: stretch; /* Stretch to fill width */
    }

    .main-nav ul li {
        margin: 0; /* Remove horizontal margin */
        margin-bottom: 10px; /* Add vertical margin */
        text-align: center;
    }

    .main-nav .nav-link,
    .cta-button,
    .auth-link { /* Added .auth-link to responsive styling */
        display: block; /* Make links/buttons fill their container */
        width: 100%;
        padding: 12px 0; /* Adjust padding for stacked items */
    }

    /* Adjust the user-auth-status for mobile */
    .user-auth-status {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }


    .search-bar {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar input,
    .search-bar button {
        margin-right: 0; /* Remove horizontal margin when stacked */
        width: 100%; /* Ensure they take full width */
    }

    .hero {
        padding: 60px 0;
    }

    .hero .container h1 {
        font-size: 2rem;
    }
    .hero .container p {
        font-size: 1rem;
    }

    .form-section {
        padding: 25px;
        margin: 30px auto;
    }

    /* Removed .category-grid media query, as it's no longer used */
    /* .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    } */

    .business-list {
        grid-template-columns: 1fr;
    }

    /* Adjust auth buttons for mobile */
    #auth-section button[type="button"] {
        display: block; /* Stack buttons */
        width: 100%;
        margin: 10px auto; /* Center with vertical margin */
    }
}

@media (max-width: 480px) {
    /* Removed .category-grid media query, as it's no longer used */
    /* .category-grid {
        grid-template-columns: 1fr;
    } */
}
