body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ff6f00; /* Daangn's signature orange */
    margin: 0;
}

.search-bar {
    display: flex;
    flex-grow: 1;
    margin: 0 20px;
}

.search-bar input {
    flex-grow: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    background-color: #ff6f00;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    margin-left: -40px; /* Overlap with input for integrated look */
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background-color: #e66000;
}

.sell-button {
    background-color: #4CAF50; /* A green color for "Sell" */
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sell-button:hover {
    background-color: #45a049;
}

/* Main Content */
.main-content {
    display: flex;
    padding-top: 20px;
}

/* Sidebar */
.sidebar {
    width: 200px;
    margin-right: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: fit-content; /* Adjust height to content */
}

.sidebar h3 {
    margin-top: 0;
    color: #ff6f00;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#category-filters {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    padding: 8px 0;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    transition: color 0.2s, font-weight 0.2s;
}

.category-item:hover {
    color: #ff6f00;
    font-weight: bold;
}

.category-item.active {
    color: #ff6f00;
    font-weight: bold;
}

/* Item List */
.item-list {
    flex-grow: 1;
}

#item-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Slightly smaller cards */
    gap: 20px;
}

.item {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out;
}

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

.item img {
    width: 100%;
    height: 150px; /* Fixed height for images */
    object-fit: cover; /* Cover the area without distortion */
    display: block;
}

.item-details {
    padding: 10px;
}

.item-details h3 {
    font-size: 16px;
    margin: 5px 0;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-details .price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6f00;
    margin-bottom: 5px;
}

.item-details .location {
    font-size: 13px;
    color: #777;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

#dark-mode-checkbox {
    display: none;
}

.toggle-label {
    display: block;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-label::after {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s, transform 0.3s;
}

#dark-mode-checkbox:checked + .toggle-label {
    background-color: #ff6f00;
}

#dark-mode-checkbox:checked + .toggle-label::after {
    left: 26px;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .header {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .search-bar input {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .sidebar {
    background-color: #1e1e1e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .sidebar h3 {
    border-bottom-color: #333;
}

body.dark-mode .category-item {
    color: #bbb;
}

body.dark-mode .category-item:hover {
    color: #ff6f00;
}

body.dark-mode .category-item.active {
    color: #ff6f00;
}

body.dark-mode .item {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .item-details h3 {
    color: #e0e0e0;
}

body.dark-mode .item-details .location {
    color: #aaa;
}
