/* Reset y base */
* {
    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: #f8f9fa;
}

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

/* Floating Menu */
.floating-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.menu-btn {
    background: #007bff;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.menu-content {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
}

.menu-content.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.menu-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.header h1 {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: #666;
}

/* Search Container */
.search-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px 0 0 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    border-color: #007bff;
}

.search-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #0056b3;
}

.location-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.radius-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radius-selector select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Ads Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.ad-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.ad-image {
    height: 250px;
    overflow: hidden;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-image img {
    transform: scale(1.05);
}

.ad-content {
    padding: 20px;
}

.ad-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.ad-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.ad-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ad-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-contact {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-contact:hover {
    background: #218838;
}

.ad-distance {
    color: #666;
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.coordinates {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-family: monospace;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

/* No Ads */
.no-ads {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-ads i {
    margin-bottom: 20px;
    color: #ddd;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Map */
#selectionMap,
#formMap {
    height: 400px;
    width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

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

    .location-controls {
        flex-direction: column;
    }

    .search-bar {
        flex-direction: column;
    }

    #searchInput {
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .search-btn {
        border-radius: 10px;
    }

    .floating-menu {
        top: 10px;
        right: 10px;
    }

    .menu-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}