:root {
    --bg-color: #f4f4f4;
    --card-bg: #ffffff;
    --text-color: #333333;
    --header-bg: #333333;
    --border-color: #cccccc;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --header-bg: #111111;
    --border-color: #444444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

.card {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--text-color);
}

header {
    background: var(--header-bg);
    color: #fff;
    padding-top: 30px;
    min-height: 70px;
    border-bottom: #77d42a 3px solid;
    margin-bottom: 20px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 20px;
}

header {
    background: #333;
    color: #fff;
    padding-top: 30px;
    min-height: 70px;
    border-bottom: #77d42a 3px solid;
    margin-bottom: 20px;
}

header a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
}

header ul {
    padding: 0;
    list-style: none;
}

header li {
    float: left;
    display: inline;
    padding: 0 20px 0 20px;
}

header #branding {
    float: left;
}

header #branding h1 {
    margin: 0;
}

header nav {
    float: right;
    margin-top: 10px;
}

.card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.listing-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

.price {
    color: #2c3e50;
    font-weight: bold;
    font-size: 1.2em;
}

.btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 5px;
}

.btn:hover {
    background: #77d42a;
}

form input, form textarea, form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.gallery img {
    width: calc(33.333% - 10px);
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.replies-section {
    margin-top: 30px;
    border-top: 1px solid #ccc;
    padding-top: 20px;
}

.reply {
    background: #e9ecef;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.reply-author {
    font-weight: bold;
}

.reply-date {
    font-size: 0.8em;
    color: #666;
}

.menu-toggle {
    display: none;
    float: right;
    font-size: 24px;
    cursor: pointer;
    margin-top: 10px;
}

.mobile-only {
    display: none;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
}

.pagination .active {
    background: #77d42a;
    color: white;
    border-color: #77d42a;
}

.swiper {
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.social-share {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.social-share a {
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
}

.share-fb { background: #3b5998; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }

/* Rating Stars */
.rating-stars {
    color: #ddd;
    font-size: 24px;
    cursor: pointer;
}
.rating-stars .fa-star.checked {
    color: #f1c40f;
}
.homepage-rating {
    color: #f1c40f;
    margin-bottom: 10px;
}

/* Back to Top Button */
#backToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    background-color: #333;
    color: white;
    border: none;
    outline: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}
#backToTop:hover {
    background-color: #77d42a;
}

/* Theme Toggle */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    float: right;
    margin-left: 20px;
    margin-top: 10px;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}
.theme-switch input {
    display:none;
}
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #77d42a;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* Global Search Bar */
.global-search {
    background: var(--card-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.global-search form {
    display: flex;
    gap: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}
.global-search input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
}
.global-search .btn {
    padding: 10px 20px;
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 1000;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}
.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.suggestion-item:hover {
    background: var(--bg-color);
}
.suggestion-item:last-child {
    border-bottom: none;
}

/* Reply Reactions */
.reply-reactions {
    margin-top: 10px;
    display: flex;
    gap: 15px;
}
.reaction-btn {
    cursor: pointer;
    font-size: 0.9em;
    color: #888;
    transition: color 0.3s;
}
.reaction-btn:hover {
    color: #77d42a;
}
.reaction-btn.active-like {
    color: #77d42a;
}
.reaction-btn.active-dislike {
    color: #e74c3c;
}

/* GDPR Popup */
#gdpr-consent {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #333;
    color: white;
    padding: 20px;
    text-align: center;
    z-index: 10000;
    display: none;
}
#gdpr-consent button {
    background: #77d42a;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-left: 20px;
    cursor: pointer;
    border-radius: 5px;
}

/* Menu Click Effects */
header nav ul li a {
    position: relative;
    transition: color 0.3s;
}
header nav ul li a:active {
    transform: scale(0.95);
}
header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #77d42a;
    transition: width 0.3s;
}
header nav ul li a:hover::after {
    width: 100%;
}

@media(max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    header nav {
        width: 100%;
        float: none;
    }
    header nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #444;
        position: absolute;
        left: 0;
        top: 70px;
        z-index: 1000;
    }
    header nav ul.active {
        display: flex;
    }
    header li {
        float: none;
        padding: 15px;
        border-bottom: 1px solid #555;
    }
    .mobile-only {
        display: block;
    }
    .gallery img {
        width: calc(50% - 10px);
    }
    .swiper {
        height: 250px;
    }
}
