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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f1e8;
    color: #222;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 70px;
    background-color: #2f5d3a;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
}

.logo-container {
    position: absolute;
    top: 5px;
    left: 15px;
}

.logo-img {
    height: 180px;
    width: auto;
    max-width: 200px;
    border-radius: 8px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #f4c542;
    font-weight: bold;
}

.nav-links a:hover {
    color: white;
}

.page-content {
    margin-top: 120px;
    padding: 40px;
    text-align: center;
}

.site-summary {
    margin-top: 90px;
    padding: 40px 20px 20px 20px;
    text-align: center;
}

.site-summary h2 {
    color: #2f5d3a;
    margin-bottom: 15px;
}

.site-summary p {
    max-width: 850px;
    margin: 0 auto;
    line-height: 1.6;
    color: #444;
}

.hero {
    text-align: center;
    padding: 70px 20px;
    background-color: #d4e6c3;
}

.hero h1 {
    color: #2f5d3a;
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    color: #444;
    font-size: 18px;
}

.hero-buttons {
    margin-top: 25px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 25px;
    margin: 5px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.btn-primary {
    background-color: #2f5d3a;
    color: white;
}

.btn-secondary {
    background-color: #f4c542;
    color: #2f5d3a;
}

.featured {
    padding: 50px 40px;
    text-align: center;
}

.featured h2 {
    color: #2f5d3a;
    margin-bottom: 20px;
}

input,
select,
textarea {
    padding: 10px;
    margin: 10px;
    width: 300px;
    max-width: 90%;
    border: 1px solid #999;
    border-radius: 5px;
}

textarea {
    min-height: 100px;
}

button {
    padding: 10px 18px;
    margin: 8px 4px;
    background-color: #2f5d3a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background-color: #244a2e;
    transform: scale(1.03);
}

.delete-btn {
    background-color: #9b2c2c;
}

.delete-btn:hover {
    background-color: #7b1f1f;
}

.favorite-btn {
    background-color: #d49b00;
    color: #222;
}

.favorite-btn:hover {
    background-color: #b88600;
}

.contact-btn {
    background-color: #245f91;
}

.contact-btn:hover {
    background-color: #1c4d75;
}

.listing-container,
#listingsContainer,
#myListingsContainer,
#recentListings,
#savedListingsContainer {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
}

.listing-card {
    background: white;
    width: 270px;
    min-height: 430px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    text-align: left;
    position: relative;
    transition: 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-5px);
}

.listing-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.listing-card h3 {
    margin-bottom: 10px;
    color: #2f5d3a;
}

.listing-card p {
    margin-bottom: 8px;
}

.card-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sold-text {
    color: red;
    font-weight: bold;
}

.sold-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: red;
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    border-radius: 6px;
    z-index: 2;
}

.search-controls {
    margin: 20px auto;
    max-width: 900px;
}

.search-bar {
    width: 350px;
    max-width: 90%;
}

.details-card {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.details-card img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: #eee;
}

.profile-card {
    max-width: 520px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.profile-card h2 {
    color: #2f5d3a;
    margin-bottom: 15px;
}

.profile-card p {
    margin-bottom: 12px;
}

.stats-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.stat-box {
    background: white;
    min-width: 150px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-box h3 {
    color: #2f5d3a;
    margin-bottom: 10px;
}

.message-layout {
    max-width: 950px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    text-align: left;
}

.message-panel,
.chat-panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    min-height: 420px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.chat-box {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fafafa;
    margin-bottom: 12px;
}

.message-item {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #eef4ee;
}

.message-mine {
    background: #d4e6c3;
}

.small-note {
    color: #666;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #2f5d3a;
    color: #f7dc6f;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .navbar {
        justify-content: center;
        padding: 10px 15px;
        min-height: 110px;
    }

    .logo-container {
        position: static;
        margin-right: auto;
    }

    .nav-links {
        gap: 10px;
        justify-content: center;
        width: 100%;
        margin-top: 10px;
        font-size: 0.9rem;
    }

    .page-content {
        margin-top: 150px;
        padding: 20px;
    }

    .site-summary {
        margin-top: 130px;
    }

    .listing-card {
        width: 92%;
        min-height: auto;
    }

    .hero h1 {
        font-size: 28px;
    }

    .message-layout {
        grid-template-columns: 1fr;
    }
}

.login-page {
    margin-top: 110px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-about {
    max-width: 850px;
    background: #d4e6c3;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.login-about h2 {
    color: #2f5d3a;
    margin-bottom: 12px;
}

.login-about p {
    color: #333;
    line-height: 1.6;
}

.login-card {
    width: 420px;
    max-width: 95%;
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.login-card h1 {
    color: #2f5d3a;
    margin-bottom: 8px;
}

.login-card input {
    width: 90%;
}

.login-link {
    margin-top: 15px;
}

.login-link a {
    color: #2f5d3a;
    font-weight: bold;
}

@media (max-width: 768px) {
    .login-page {
        margin-top: 140px;
    }

    .login-about {
        padding: 20px;
    }

    .login-card {
        padding: 22px;
    }
}

.conversation-tile {
    background: #f5f1e8;
    border: 1px solid #d0c7b6;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.conversation-tile:hover {
    background: #d4e6c3;
    transform: translateY(-2px);
}

.conversation-tile h3 {
    color: #2f5d3a;
    margin-bottom: 6px;
}

.conversation-tile p {
    margin-bottom: 5px;
}

.conversation-tile small {
    color: #666;
}
