/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
header {
    background: linear-gradient(135deg, #fc4d50 0%, #ff6b6b 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Main content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #333;
}

.stats-summary {
    display: flex;
    gap: 1rem;
}

.stat {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Filters */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #555;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
}

/* Items grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.item-card.recent {
    border: 2px solid #fc4d50;
}

.item-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-content {
    padding: 1rem;
}

.item-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.item-title a:hover {
    color: #fc4d50;
}

.item-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.item-price {
    color: #fc4d50;
    font-weight: bold;
    font-size: 1.1rem;
}

.item-category {
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #666;
}

.item-shop {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.item-shop a {
    color: #333;
    text-decoration: none;
}

.item-shop a:hover {
    text-decoration: underline;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.search-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.item-time {
    color: #999;
    font-size: 0.85rem;
}

.no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    color: #666;
}

/* Statistics page */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-card h3 {
    color: #666;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: bold;
    color: #fc4d50;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 5px;
}

.stat-label {
    font-weight: 500;
}

.stat-count {
    background: #fc4d50;
    color: white;
    padding: 0.2rem 0.75rem;
    border-radius: 15px;
    font-weight: bold;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-group select {
        width: 100%;
    }
}
