/**
 * The Land - Village Discovery Styles
 * Airbnb-inspired design
 */

/* Search & Filters Bar */
.search-filters-bar {
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: 50px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.search-button:hover {
    background: var(--color-primary-light);
    transform: translateY(-50%) scale(1.1);
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.filter-select {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:hover {
    border-color: var(--color-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.clear-filters-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Villages Grid - Airbnb Style */
.villages-section {
    padding: 3rem 0;
    min-height: 60vh;
}

.villages-grid-airbnb {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.village-card-airbnb {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.village-card-airbnb:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--color-primary);
}

/* Village Image */
.village-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.village-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.village-card-airbnb:hover .village-photo {
    transform: scale(1.05);
}

.village-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.8) 0%, rgba(139, 105, 20, 0.8) 100%);
}

.village-icon {
    font-size: 4rem;
    opacity: 0.7;
}

.village-badge-top {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Village Card Content */
.village-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.village-header {
    margin-bottom: 0.75rem;
}

.village-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    line-height: 1.2;
}

.village-location {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.village-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0.75rem 0;
    flex: 1;
}

.village-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.stat-item {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.village-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.btn-view-village,
.btn-join-village {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-view-village {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text);
}

.btn-view-village:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-join-village {
    background: var(--color-primary);
    border: 2px solid var(--color-primary);
    color: var(--color-text);
}

.btn-join-village:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 80, 22, 0.3);
}

.btn-member-badge {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid rgba(16, 185, 129, 0.5);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #10b981;
    font-size: 0.95rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Photo Gallery - Airbnb Style */
.village-photo-gallery {
    padding: 2rem 0;
    background: var(--color-bg);
}

.photo-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.5rem;
    border-radius: 16px;
    overflow: hidden;
    max-height: 500px;
}

.gallery-main-photo {
    width: 100%;
    height: 500px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-main-photo:hover img {
    transform: scale(1.05);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.gallery-thumb {
    position: relative;
    width: 100%;
    height: calc((500px - 0.5rem) / 2);
    overflow: hidden;
    cursor: pointer;
    border-radius: 0;
}

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

.gallery-thumb:hover img {
    transform: scale(1.1);
}

.gallery-more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Photo Modal */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.photo-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.photo-modal-prev {
    left: -60px;
}

.photo-modal-next {
    right: -60px;
}

@media (max-width: 768px) {
    .photo-gallery-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .gallery-main-photo {
        height: 300px;
    }

    .gallery-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-thumb {
        height: 75px;
    }

    .photo-modal-nav {
        display: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .villages-grid-airbnb {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .search-filters-bar {
        top: 70px;
        padding: 1.5rem 0;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .village-actions {
        flex-direction: column;
    }

    .btn-view-village,
    .btn-join-village {
        width: 100%;
    }
}

