/**
 * Apartment Archive Styles
 */

/* Container and Layout */
.websy-apartment-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.websy-archive-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Section */
.websy-archive-header {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.websy-archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); */
}

.websy-archive-description {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* Filters Section */
.websy-filters-container {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.websy-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.websy-filters-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.websy-filters-toggle {
    display: none;
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    align-items: center;
    gap: 8px;
}

.websy-filters-toggle:hover {
    background: #005a87;
}

.websy-filters-form {
    padding: 30px;
}

.websy-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.websy-filter-group {
    display: flex;
    flex-direction: column;
}

.websy-filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
}

.websy-filter-group select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.websy-filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.websy-filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.websy-filter-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.websy-filter-reset:hover {
    background: #5a6268;
}

.websy-filter-apply {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.websy-filter-apply:hover {
    background: #005a87;
}

/* Results Section */
.websy-results-container {
    padding: 30px;
}

.websy-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.websy-results-count {
    font-size: 16px;
    color: #6c757d;
}

.websy-results-sorting select {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

/* Apartments Grid */
.websy-apartments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.websy-apartment-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.websy-apartment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.websy-apartment-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.websy-apartment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.websy-apartment-card:hover .websy-apartment-image img {
    transform: scale(1.05);
}

.websy-availability-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.websy-availability-badge.available {
    background: #28a745;
    color: white;
}

.websy-availability-badge.unavailable {
    background: #dc3545;
    color: white;
}

.websy-apartment-content {
    padding: 20px;
}

.websy-apartment-header {
    margin-bottom: 15px;
}

.websy-apartment-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.websy-apartment-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.websy-apartment-title a:hover {
    color: #007cba;
}

.websy-apartment-type {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
}

/* Apartment badges */
.websy-apartment-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.websy-apartment-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.websy-apartment-availability {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.websy-apartment-availability.available {
    background: #28a745;
    color: white;
}

.websy-apartment-availability.unavailable {
    background: #dc3545;
    color: white;
}

.websy-apartment-price {
    background: #007cba;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

/* Apartment details */
.websy-apartment-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.websy-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
}

.websy-detail-icon {
    font-size: 14px;
}

.websy-detail-text {
    font-weight: 500;
}

.websy-apartment-hierarchy {
    margin-bottom: 15px;
}

.websy-hierarchy-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.websy-hierarchy-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.websy-hierarchy-icon {
    font-size: 12px;
}

.websy-hierarchy-text {
    white-space: nowrap;
}

.websy-hierarchy-separator {
    color: #adb5bd;
    font-weight: 300;
}

.websy-apartment-actions {
    margin-top: auto;
}

.websy-apartment-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #007cba;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.websy-apartment-view-btn:hover {
    background: #005a87;
    transform: translateX(2px);
}

.websy-btn-arrow {
    transition: transform 0.2s ease;
}

.websy-apartment-view-btn:hover .websy-btn-arrow {
    transform: translateX(4px);
}

.websy-apartment-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

/* Loading State */
.websy-apartments-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.websy-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.websy-no-apartments {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.websy-no-apartments-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.websy-no-apartments h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #495057;
}

.websy-no-apartments p {
    margin: 0;
    font-size: 16px;
}

/* Error State */
.websy-apartments-error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.websy-apartments-error h3 {
    margin: 0 0 10px 0;
    color: #dc3545;
}

.websy-error-retry {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.websy-error-retry:hover {
    background: #c82333;
}

/* Pagination */
.websy-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 40px;
}

.websy-pagination button {
    background: white;
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #000;
}

.websy-pagination button:hover {
    background: #f8f9fa;
    border-color: #007cba;
}

.websy-pagination button.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.websy-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* WordPress Pagination Links */
.websy-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.websy-pagination-container .page-numbers {
background: white;
    /* border: 1px solid #e9ecef; */
    /* padding: 8px 12px; */
    /* border-radius: 4px; */
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* min-width: 40px; */
    /* height: 40px; */
}

.websy-pagination-container .page-numbers:hover {
    background: #f8f9fa;
    border-color: #007cba;
    color: #007cba;
}

.websy-pagination-container .page-numbers.current span {
    background: #007cba;
    color: white;
    border-color: #007cba;
    cursor: default;
}

.websy-pagination-container .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    padding: 8px 4px;
}

.websy-pagination-container .page-numbers.dots:hover {
    background: transparent;
    border: none;
    color: #000;
}

/* Ensure spans inside pagination links are properly styled */
.websy-pagination-container .page-numbers .websy-pagination-btn {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 1;
    color: inherit;
    text-decoration: none;
    pointer-events: none; /* Let the parent handle the click */
}

/* Responsive Design */
@media (max-width: 768px) {
    .websy-apartment-archive {
        padding: 10px;
    }
    
    .websy-archive-header {
        padding: 30px 20px;
    }
    
    .websy-archive-title {
        font-size: 2rem;
    }
    
    .websy-filters-header {
        padding: 15px 20px;
    }
    
    .websy-filters-toggle {
        display: flex;
    }
    
    .websy-filters-form {
        padding: 20px;
        display: none;
    }
    
    .websy-filters-form.active {
        display: block;
    }
    
    .websy-filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .websy-filter-actions {
        justify-content: stretch;
    }
    
    .websy-filter-actions button {
        flex: 1;
    }
    
    .websy-results-container {
        padding: 20px;
    }
    
    .websy-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .websy-apartments-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .websy-pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .websy-archive-title {
        font-size: 1.5rem;
    }
    
    .websy-apartment-image {
        height: 180px;
    }
    
    .websy-apartment-content {
        padding: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .websy-apartment-card,
    .websy-apartment-image img,
    .websy-loading-spinner {
        animation: none;
        transition: none;
    }
}

/* Focus styles for keyboard navigation */
.websy-apartment-card:focus,
.websy-apartment-title a:focus,
button:focus,
select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .websy-apartment-card {
        border: 2px solid #000;
    }
    
    .websy-availability-badge.available {
        background: #000;
        color: #fff;
    }
    
    .websy-availability-badge.unavailable {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}


