/* Basic reset and global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Header and Navigation */
header {
    background: #0056b3;
    color: #fff;
    padding: 1rem 0;
    position: relative;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Default Desktop Navigation */
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Menu Icon (Hidden on Desktop by default) */
.menu-icon {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-icon div {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Main content area */
main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    min-height: 70vh;
}

/* Footer */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

footer a {
    color: #fff;
    text-decoration: none;
}

/* ===== RESPONSIVE DESIGN - MOBILE STYLES ===== */
@media screen and (max-width: 768px) {
    /* Show the mobile menu icon */
    .menu-icon {
        display: flex;
    }

    /* Hide the navigation links by default and style for mobile */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen */
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: #0056b3;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.5s ease;
        z-index: 1000;
        padding-top: 60px;
    }

    /* Class to show the menu when the icon is clicked */
    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }

    /* Transform the hamburger icon into a close (X) icon when active */
    .menu-icon.active .bar1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .menu-icon.active .bar2 {
        opacity: 0;
    }

    .menu-icon.active .bar3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* ===== HOMEPAGE HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #fff;
    color: #0056b3;
}

.btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background-color: #fff;
    color: #0056b3;
    transform: translateY(-2px);
}

/* ===== FEATURED COMPANIES SECTION ===== */
.featured-companies {
    margin: 3rem 0;
}

.featured-companies h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.company-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.company-card h3 {
    color: #0056b3;
    margin-bottom: 0.5rem;
}

.company-card p {
    color: #666;
    margin-bottom: 1rem;
}

.company-card a {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

.company-card a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN FOR HOMEPAGE ===== */
@media screen and (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
        text-align: center;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ACCOUNT SETTINGS PAGE ===== */
.account-settings-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.current-avatar {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0056b3;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* ===== FORM CONTAINERS ===== */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0056b3;
}

.login-link {
    text-align: center;
    margin-top: 1.5rem;
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.dashboard-actions {
    margin-top: 2rem;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== COMPANY PROFILE PAGE ===== */
/* Company Hero Header */
.company-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.company-branding {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.company-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.company-info h1 {
    color: #0056b3;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

.company-category {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

/* Company Social Links */
.company-social {
    display: flex;
    gap: 15px;
}

.social-link {
    padding: 8px 15px;
    background: #0056b3;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.social-link:hover {
    background: #003d7a;
}

/* Company Description */
.company-description {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.company-description h2 {
    color: #0056b3;
    margin-bottom: 1rem;
}

/* Responsive Design for Company Header */
@media screen and (max-width: 768px) {
    .company-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .company-branding {
        flex-direction: column;
    }
    
    .company-social {
        justify-content: center;
    }
}

/* ===== HOMEPAGE SEARCH BAR ===== */
.search-bar-container {
    margin: 2rem auto;
    max-width: 600px;
}

.search-bar-container form {
    display: flex;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

.search-bar-container input[type="text"] {
    flex-grow: 1;
    padding: 15px 25px;
    border: none;
    font-size: 1.1rem;
    outline: none;
}

.search-bar-container button {
    padding: 15px 30px;
    background: #0056b3;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s ease;
}

.search-bar-container button:hover {
    background: #003d7a;
}

/* Responsive search bar */
@media screen and (max-width: 768px) {
    .search-bar-container form {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .search-bar-container input[type="text"] {
        border-radius: 8px 8px 0 0;
    }
    
    .search-bar-container button {
        border-radius: 0 0 8px 8px;
    }
}

/* ===== SEARCH AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

.autocomplete-items div:hover,
.autocomplete-items .autocomplete-active {
    background-color: #0056b3;
    color: white;
}

/* Ensure the search button stays on top of the dropdown */
.search-bar-container button {
    z-index: 100;
    position: relative;
}

/* ===== COMPANY REVIEWS SECTION ===== */
.company-reviews {
    margin: 2rem 0;
}

.no-reviews {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #0056b3;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.review-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #e9ecef !important;
    flex-shrink: 0; /* Prevents the image from shrinking in flexbox layouts */
}

.review-user-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-user-info strong {
    color: #333;
}

.verified-badge {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: bold;
}

.review-rating {
    color: #ffc107; /* Gold color for stars */
    font-size: 1.2rem;
    white-space: nowrap;
}

.review-title {
    color: #0056b3;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.review-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.review-date {
    color: #6c757d;
    font-size: 0.85rem;
    text-align: right;
    margin: 0;
}

/* Responsive design for reviews */
@media screen and (max-width: 768px) {
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .review-rating {
        align-self: flex-start;
    }
}