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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: white;
    color: #4CAF50;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.btn-primary:hover {
    background: #F57C00;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Search Panel */
.search-panel {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Map */
.map-container {
    width: 100%;
    height: 500px;
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#map {
    width: 100%;
    height: 100%;
}

/* Listings Grid */
.listings-grid h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.8rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.listing-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.listing-header h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    flex: 1;
}

.price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4CAF50;
    white-space: nowrap;
}

.free-badge {
    background: #4CAF50;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.description {
    color: #666;
    margin-bottom: 1rem;
    min-height: 60px;
}

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

.seller, .rating {
    font-size: 0.9rem;
    color: #777;
}

.availability {
    font-size: 0.9rem;
    color: #FF9800;
    margin-bottom: 1rem;
    font-style: italic;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav {
        width: 100%;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    .map-container {
        height: 400px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Alert messages */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Form styling */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 2rem auto;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-container .btn {
    width: 100%;
    margin-top: 1rem;
}

/* Photo upload preview */
.photo-preview {
    max-width: 100%;
    max-height: 300px;
    margin-top: 1rem;
    border-radius: 5px;
    display: none;
}

.photo-preview.active {
    display: block;
}