/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 20px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

.logo span {
    font-size: 1.4em;
    font-weight: 700;
    color: #f0b90b;
    letter-spacing: 0.5px;
}

.navbar ul {
    display: flex;
    list-style: none;
}

.navbar li {
    margin-left: 30px;
}

.navbar a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 1em;
    transition: color 0.3s ease;
}

.navbar a:hover, .navbar a.active {
    color: #f0b90b;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    padding: 40px 20px;
    background: #fff;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    color: #f0b90b;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-text p {
    color: #666;
    font-size: 1.1em;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Content List */
.content-list {
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.filters {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

#searchInput {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

#sortSelect {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: #fafafa;
    cursor: pointer;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    grid-auto-flow: row;
    width: 100%;
}

.content-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    min-height: 250px;
    width: 100%;
    box-sizing: border-box;
}

.content-item.empty {
    background: transparent;
    box-shadow: none;
    min-height: 250px;
    width: 100%;
    box-sizing: border-box;
}

.content-item:hover:not(.empty) {
    transform: translateY(-5px);
}

.content-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.content-item .owner-address {
    font-size: 0.9em;
    color: #f0b90b;
    font-weight: 600;
    margin-bottom: 5px;
}

.content-item h3 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.content-item p {
    font-size: 0.95em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0b90b, #d9a008);
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.pagination button:hover {
    background: linear-gradient(90deg, #d9a008, #f0b90b);
    transform: translateY(-2px);
}

.pagination button:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

.pagination span {
    font-size: 1em;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    header {
        padding: 15px 10px; /* Reduce padding for mobile */
    }

    .navbar {
        display: none;
        position: absolute;
        top: 70px;
        right: 10px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 15px;
        width: 200px; /* Limit navbar width */
    }

    .navbar.active {
        display: flex;
        flex-direction: column;
    }

    .navbar li {
        margin: 10px 0;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 20px 10px; /* Reduce hero padding */
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 0 10px;
    }

    .hero-text h1 {
        font-size: 1.8em; /* Smaller font size for mobile */
    }

    .hero-text p {
        font-size: 1em;
    }

    .content-list {
        padding: 20px 10px; /* Reduce padding for content list */
    }

    .container {
        padding: 0; /* Remove container padding */
    }

    .filters {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    #searchInput {
        flex: none;
        width: 100%;
        padding: 10px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    #sortSelect {
        flex: none;
        width: 100%;
        padding: 10px;
        font-size: 16px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }

    .content-item {
        padding: 15px;
        min-height: auto; /* Adjust height based on content */
    }

    .content-item.empty {
        display: none;
    }

    .content-item img {
        height: 120px; /* Smaller image height for mobile */
    }

    .content-item h3 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }

    .content-item p {
        font-size: 0.9em;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3; /* Limit to 3 lines */
        -webkit-box-orient: vertical;
        line-height: 1.4;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .pagination button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    .pagination span {
        text-align: center;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 15px;
    }

    .content-item.empty {
        display: none;
    }

    .content-item {
        padding: 15px;
    }

    .content-item img {
        height: 130px;
    }

    .content-item h3 {
        font-size: 1.15em;
    }

    .content-item p {
        font-size: 0.95em;
    }
}