/**
 * Tour Archive Template Styles
 * 
 * @package RoamEase_Pro
 * @since 2.0.0
 */

/* Archive Container */
.roamease-archive-container {
    background: var(--re-bg, #f8f9fa);
    min-height: 100vh;
}

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

/* Archive Header */
.archive-header {
    background: var(--re-accent, #ff7a18);
    color: var(--re-on-accent, #ffffff);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.archive-header .container {
    position: relative;
    z-index: 2;
}

.archive-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.archive-description {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Search and Filters */
.tours-filters {
    background: var(--re-bg, #ffffff);
    padding: 40px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--re-border, #e9ecef);
    border-radius: 8px;
    font-size: 14px;
    background: var(--re-bg, #ffffff);
    transition: all 0.3s ease;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--re-accent, #ff7a18);
    box-shadow: 0 0 0 3px rgba(var(--re-accent-rgb, 255, 122, 24), 0.15);
}

.filter-group .btn {
    margin-right: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.filter-group .btn-primary {
    background: var(--re-accent, #ff7a18);
    color: var(--re-on-accent, #ffffff);
}

.filter-group .btn-primary:hover {
    background: var(--re-primary, #e96b0b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--re-accent-rgb, 255, 122, 24), 0.3);
}

.filter-group .btn-secondary {
    background: var(--re-bg, #ffffff);
    color: var(--re-accent, #ff7a18);
    border: 2px solid var(--re-border, #ffd08a);
}

.filter-group .btn-secondary:hover {
    background: var(--re-bg, #fff4e6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--re-accent-rgb, 255, 122, 24), 0.2);
}

/* Tours Content */
.tours-content {
    padding: 60px 0;
}

/* Tours Grid */
.tours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    min-height: 200px;
}

/* Loading state for filters */
.tours-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(var(--re-bg-rgb, 255, 255, 255), 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.filter-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--re-accent, #ff7a18);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.filter-loading p {
    margin: 0;
    color: var(--re-text, #666);
    font-size: 14px;
}

/* Results counter */
.filter-results-count {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background: var(--re-bg, #f8f9fa);
    border-radius: 6px;
    color: var(--re-text, #666);
    font-size: 14px;
    font-weight: 500;
}

/* No tours found styling */
.no-tours-found {
    text-align: center;
    padding: 60px 20px;
    color: var(--re-text, #666);
}

.no-tours-found h3 {
    margin-bottom: 10px;
    color: var(--re-heading, #333);
}

.no-tours-found p {
    margin: 0;
    font-size: 16px;
}

/* Ensure search results use same grid layout */
.search-results .tours-grid,
.search .tours-grid,
body.search .tours-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Override any theme search result styling */
.search-results .hentry,
.search .hentry,
body.search .hentry {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

/* Ensure search results container uses grid */
.search-results .tours-content,
.search .tours-content,
body.search .tours-content {
    padding: 60px 0;
}

.search-results .tours-content .container,
.search .tours-content .container,
body.search .tours-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--re-border, #e9ecef);
}

/* Pagination */
.tours-pagination {
    margin-top: 50px;
    text-align: center;
}

.tours-pagination .page-numbers {
    display: inline-block;
    padding: 12px 18px;
    margin: 0 5px;
    background: var(--re-bg, #ffffff);
    border: 2px solid var(--re-border, #e9ecef);
    border-radius: 8px;
    color: var(--re-text, #495057);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tours-pagination .page-numbers:hover,
.tours-pagination .page-numbers.current {
    background: var(--re-accent, #ff7a18);
    border-color: var(--re-accent, #ff7a18);
    color: var(--re-on-accent, #ffffff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--re-accent-rgb, 255, 122, 24), 0.3);
}

/* No Results State */
.no-tours-found {
    text-align: center;
    padding: 80px 20px;
    background: var(--re-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 40px auto;
    max-width: 600px;
}

/* Responsive Design */
@media (max-width: 1199px) {
    /* Tablet Layout - 2 columns */
    .tours-grid,
    .search-results .tours-grid,
    .search .tours-grid,
    body.search .tours-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    /* Mobile Layout - 1 column */
    .tours-grid,
    .search-results .tours-grid,
    .search .tours-grid,
    body.search .tours-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Mobile Filter Layout - Stack vertically */
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .archive-title {
        font-size: 2.5rem;
    }
    
    .archive-description {
        font-size: 1.1rem;
    }
    
    .archive-header {
        padding: 60px 0 40px;
    }
    
    .tours-content {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .archive-title {
        font-size: 2rem;
    }
    
    .archive-header {
        padding: 40px 0 30px;
    }
    
    .tours-filters {
        padding: 30px 0;
    }
    
    .tours-content {
        padding: 30px 0;
    }
}