/**
 * ═══════════════════════════════════════════════════════════════════
 * ATC Search Results Grid - MakeMyTrip Style
 * Location: assets/css/atc-results-grid.css
 * ═══════════════════════════════════════════════════════════════════
 */

/* ==================== MAIN LAYOUT ==================== */
.atc-search-results-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ==================== FILTERS SIDEBAR ==================== */
.atc-filters-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.atc-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.atc-filters-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0A1F44;
}

.atc-filters-reset {
    background: none;
    border: none;
    color: #0ea5e9;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s;
}

.atc-filters-reset:hover {
    background: #f0f9ff;
}

.atc-filter-group {
    margin-bottom: 25px;
}

.atc-filter-group h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #334155;
    font-weight: 600;
}

.atc-filter-group label {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: color 0.3s;
}

.atc-filter-group label:hover {
    color: #0A1F44;
}

.atc-filter-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.atc-price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.atc-price-range input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.atc-price-range input:focus {
    outline: none;
    border-color: #0ea5e9;
}

.atc-apply-filters {
    margin-top: 20px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}

/* ==================== RESULTS MAIN ==================== */
.atc-results-main {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.atc-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.atc-results-count {
    font-size: 16px;
    color: #64748b;
}

.atc-results-count .atc-count {
    font-weight: 700;
    color: #0A1F44;
    font-size: 18px;
}

.atc-results-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* View Toggle */
.atc-view-toggle {
    display: flex;
    gap: 5px;
    background: #f8fafc;
    padding: 4px;
    border-radius: 8px;
}

.atc-view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.atc-view-btn:hover {
    background: #e2e8f0;
    color: #0A1F44;
}

.atc-view-btn.active {
    background: #0ea5e9;
    color: #fff;
}

.atc-sort-select {
    padding: 8px 32px 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23334155' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
}

.atc-sort-select:focus {
    outline: none;
    border-color: #0ea5e9;
}

/* ==================== RESULTS GRID ==================== */
.atc-results-grid {
    display: grid;
    gap: 25px;
    min-height: 400px;
}

.atc-results-grid[data-view="grid"] {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.atc-results-grid[data-view="list"] {
    grid-template-columns: 1fr;
}

/* ==================== PACKAGE CARD (GRID VIEW) ==================== */
.atc-package-card-grid {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.atc-package-card-grid:hover {
    border-color: #0ea5e9;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.atc-package-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.atc-package-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.atc-package-card-grid:hover .atc-package-image img {
    transform: scale(1.05);
}

.atc-package-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.atc-badge {
    position: absolute;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.atc-badge-featured {
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.atc-badge-discount {
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
}

.atc-package-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.atc-package-header {
    margin-bottom: 8px;
}

.atc-package-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0A1F44;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.atc-package-location {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.atc-package-location svg {
    flex-shrink: 0;
}

.atc-package-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #64748b;
}

.atc-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.atc-rating {
    color: #f59e0b;
    font-weight: 600;
}

.atc-package-description {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.atc-package-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.atc-package-features li {
    font-size: 13px;
    color: #10b981;
    font-weight: 500;
}

.atc-package-footer {
    padding: 15px 20px;
    border-top: 2px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.atc-package-price {
    display: flex;
    flex-direction: column;
}

.atc-price-original {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}

.atc-price-current {
    font-size: 24px;
    font-weight: 700;
    color: #0A1F44;
}

.atc-price-label {
    font-size: 12px;
    color: #64748b;
}

.atc-package-actions {
    display: flex;
    gap: 8px;
}

/* ==================== PACKAGE CARD (LIST VIEW) ==================== */
.atc-package-card-list {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: grid;
    grid-template-columns: 280px 1fr auto;
    gap: 20px;
}

.atc-package-card-list:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.atc-package-card-list .atc-package-image {
    height: 100%;
    min-height: 200px;
}

.atc-package-card-list .atc-package-content {
    padding: 20px 0;
}

.atc-package-card-list .atc-package-footer {
    padding: 20px;
    border-top: none;
    border-left: 2px solid #f1f5f9;
    flex-direction: column;
    justify-content: center;
    min-width: 180px;
}

.atc-package-card-list .atc-package-actions {
    flex-direction: column;
    width: 100%;
}

.atc-package-card-list .atc-package-actions .atc-btn {
    width: 100%;
}

/* ==================== LOADING STATE ==================== */
.atc-loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #64748b;
}

.atc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== EMPTY STATE ==================== */
.atc-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.atc-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.atc-empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #0A1F44;
}

.atc-empty-state p {
    margin: 0 0 30px 0;
    color: #64748b;
    font-size: 16px;
}

/* ==================== PAGINATION ==================== */
.atc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.atc-page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.atc-page-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.atc-page-btn.active {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}

.atc-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .atc-search-results-wrapper {
        grid-template-columns: 1fr;
    }
    
    .atc-filters-sidebar {
        position: relative;
        top: 0;
    }
    
    .atc-results-grid[data-view="grid"] {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .atc-package-card-list {
        grid-template-columns: 1fr;
    }
    
    .atc-package-card-list .atc-package-image {
        height: 200px;
    }
    
    .atc-package-card-list .atc-package-footer {
        border-left: none;
        border-top: 2px solid #f1f5f9;
        flex-direction: row;
        min-width: auto;
    }
    
    .atc-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .atc-results-controls {
        width: 100%;
        justify-content: space-between;
    }
}