/* Results Page Styles - Optimized for Fast Loading */

/* Base Styles */
.opt-activity, .opt-region { display: block; margin: 15px 0; padding: 5px 0px; }
.sidebar-search-box .home-ajax-search li { display: block; padding: 0px 15px; margin: 12px 0px; }

#view-list-container {
    display: flex; height: fit-content; justify-content: center; align-items: center;
    background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 20px; margin: 20px 0px 20px 0px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.2); flex-wrap: wrap; gap: 15px;
}

.view-list-title { font-size: 14px; color: #666; margin-bottom: 10px; font-weight: 400; }

.view-list-btn {
    display: inline-flex; align-items: center; justify-content: center; background: #4CAF50; color: white;
    height: 48px; min-width: 240px; padding: 0 25px; border-radius: 8px; text-decoration: none;
    font-weight: 600; font-size: 16px; white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.view-list-btn:hover { color: white; text-decoration: none; }

.search-results { background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%); min-height: 100vh; padding: 0; }
.modern-content { max-width: 1400px; margin: 0 auto; padding: 20px; }

.modern-results-header {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%); border-radius: 24px; padding: 30px; margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.02); border: 1px solid rgba(255, 255, 255, 0.3);
}

.modern-page-title { font-size: 20px; font-weight: 700; color: #1a202c; margin: 0 0 20px 0; line-height: 1.3; }

.modern-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: #64748b; }
.breadcrumb-link { color: #3b82f6; text-decoration: none; transition: all 0.2s ease; padding: 4px 8px; border-radius: 8px; }
.breadcrumb-link:hover { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.breadcrumb-item.current { color: #374151; font-weight: 500; }
.breadcrumb-separator { color: #cbd5e1; font-weight: 300; }

.modern-results-bar {
    display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px); border-radius: 20px; padding: 20px 30px; margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.2); flex-wrap: wrap; gap: 15px;
}
.modern-results-bar.bottom-bar { margin-top: 40px; margin-bottom: 0; }

.results-info { display: flex; align-items: center; gap: 20px; }
.results-count { font-size: 16px; color: #374151; font-weight: 500; max-width: 125px; }
.results-count strong { color: #1f2937; font-weight: 700; }

.modern-map-toggle {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; border: none;
    border-radius: 15px; padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: flex; align-items: center; gap: 8px;
}
.modern-map-toggle:hover {
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}
.modern-map-toggle i { font-size: 16px; }

/* Layout Toggle Buttons */
.layout-toggle-wrapper { display: flex; align-items: center; }
.layout-toggle-buttons {
    display: flex; background: rgba(248, 250, 252, 0.8); border-radius: 12px; padding: 4px; gap: 2px;
    border: 1px solid rgba(203, 213, 225, 0.3);
}
.layout-btn {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 10px; color: #6b7280; text-decoration: none; transition: all 0.3s ease;
    border: none; background: transparent;
}
.layout-btn:hover { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.layout-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.layout-btn i { font-size: 16px; }

/* Pagination Styles */
.modern-pagination-wrapper { display: flex; align-items: center; gap: 20px; }
.pagination-info { font-size: 14px; color: #6b7280; font-weight: 500; white-space: nowrap; }
.pagination-nav { display: flex; align-items: center; gap: 8px; }
.pagination-nav a {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 12px; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #374151; text-decoration: none; transition: all 0.3s ease;
    border: 1px solid rgba(203, 213, 225, 0.3);
}
.pagination-nav a:hover:not(.inactive) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white;
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.pagination-nav a.inactive { opacity: 0.4; cursor: not-allowed; }

.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-num {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 10px; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #374151; text-decoration: none; transition: all 0.3s ease;
    border: 1px solid rgba(203, 213, 225, 0.3); font-size: 14px; font-weight: 500;
}
.page-num:hover { background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%); transform: translateY(-1px); }
.page-num.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.page-dots { color: #9ca3af; padding: 0 8px; font-weight: 500; }

/* Map Wrapper */
.modern-map-wrapper {
    display: none; border-radius: 24px; overflow: hidden; margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
}
.modern-map-wrapper #listing_map { width: 100%; height: 400px; position: relative; }
.modern-map-wrapper.active { display: block; }

/* Results Containers */
.results-container { display: flex; flex-direction: column; gap: 0; }
.results-container.hide { display: none; }

/* Top Company Banner Styles */
.top-company-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%); border: 2px solid #f59e0b;
    border-radius: 20px; padding: 20px; margin-bottom: 15px; position: relative; overflow: hidden;
}
.banner-shine {
    content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg); animation: shine 3s infinite;
}
@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
}
.banner-content { display: flex; align-items: flex-start; gap: 15px; position: relative; z-index: 2; }
.company-badge .company-logo {
    display: block; width: 60px; height: 60px; border-radius: 15px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.company-badge img { width: 100%; height: 100%; object-fit: cover; }
.banner-text { flex: 1; }
.banner-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.top-label {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; padding: 4px 12px;
    border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.info-toggle {
    background: rgba(255, 255, 255, 0.3); border: none; border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease;
}
.info-toggle:hover { background: rgba(255, 255, 255, 0.5); transform: scale(1.1); }
.banner-description { color: #92400e; font-size: 14px; line-height: 1.5; margin: 0; }
.top-info-details { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; margin-top: 15px; }
.top-info-details.active { max-height: 300px; }
.criteria-list { display: grid; gap: 8px; padding-top: 15px; border-top: 1px solid rgba(146, 64, 14, 0.2); }
.criterion { display: flex; align-items: center; gap: 10px; color: #92400e; font-size: 13px; font-weight: 500; }
.criterion i { color: #16a34a; font-size: 14px; }

/* List View Styles */
.large-list-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border-radius: 0; padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.3); border-left: none; border-right: none; border-top: none;
    border-bottom: 1px solid #e5e7eb; transition: none; position: relative; overflow: hidden;
    display: grid; grid-template-columns: 280px 1fr; gap: 0; align-items: stretch; margin-bottom: 0; min-height: 200px;
}
@media screen and (min-width: 769px) {
    .list-view .large-list-item { border-bottom-left-radius: 20px; border-top-left-radius: 20px; margin-bottom: 15px; }
}
.large-list-item.has-top-banner { margin-top: 0; }
.list-image { position: relative; overflow: hidden; width: 280px; height: 100%; min-height: 200px; margin: 0; }
@media screen and (min-width: 769px) {
    .list-view .list-image {
        border-bottom-left-radius: 20px; border-top-left-radius: 20px; height: 220px; min-height: 220px; aspect-ratio: 4 / 3;
    }
    .list-view .list-image .image-link, .list-view .list-image img { height: 100%; }
}
.list-image .image-link { display: block; width: 100%; height: 100%; }
.list-image img { width: 100%; height: 100%; object-fit: cover; transition: none; }
.trainer-badge { position: absolute; top: 12px; right: 12px; z-index: 3; }
.trainer-badge span {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; padding: 6px 12px;
    border-radius: 15px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.list-content {
    display: flex; flex-direction: column; gap: 15px; height: 100%; justify-content: space-between; padding: 25px 30px 25px 25px;
}
.list-title { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 0 0 8px 0; color: #1a202c; }
.list-title a { color: #1a202c; text-decoration: none; transition: color 0.2s ease; }
.list-title a:hover { color: #3b82f6; }
.list-company-name { font-size: 15px; font-weight: 500; margin: 0px; opacity: 0.8; }
.list-company-name a { color: #6b7280; text-decoration: none; transition: color 0.2s ease; }
.list-company-name a:hover { color: #374151; }
.list-details { display: flex; flex-direction: column; gap: 15px; }
.list-address { display: flex; align-items: center; gap: 8px; color: #6b7280; font-size: 14px; line-height: 1.4; }
.list-address i { color: #ef4444; font-size: 16px; width: 16px; }

.gmap {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); color: #374151;
    border: 1px solid rgba(209, 213, 219, 0.3); border-radius: 12px; padding: 10px 16px;
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease;
    display: inline-flex; align-items: center; gap: 6px; width: fit-content; text-decoration: none;
}
.gmap:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white;
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.gmap i { font-size: 12px; }
.gmap_gym_canvas {
    display: none; grid-column: 1 / -1; height: 300px; border-top: 1px solid #e5e7eb;
    margin: 0; border-radius: 0; box-shadow: none;
}
.gmap_gym_canvas.active { display: block; }

/* Grid View Styles */
.grid-container { display: grid; gap: 20px; }
.grid-result-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border-radius: 24px; padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.3); transition: none; position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1fr; gap: 0; align-items: start;
}
.grid-result-item.has-top-banner { margin-top: 0; }
.grid-image { position: relative; overflow: hidden; width: 100%; height: 250px; border-radius: 24px 24px 0 0; }
.grid-image .image-link { display: block; width: 100%; height: 100%; }
.grid-image img { width: 100%; height: 100%; object-fit: cover; transition: none; }
.grid-content { display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 10px 15px; justify-content: space-between; }
.grid-header { margin-bottom: 0px; }
.grid-title { font-size: 16px !important; font-weight: 500 !important; line-height: 1.2; margin: 0px 0 2px 0; color: #1a202c; }
.grid-title a { color: #1a202c; text-decoration: none; transition: color 0.2s ease; }
.grid-title a:hover { color: #3b82f6; }
.grid-company-name { font-size: 12px; font-weight: 500; margin: 0; opacity: 0.8; }
.grid-company-name a { color: #6b7280; text-decoration: none; transition: color 0.2s ease; }
.grid-company-name a:hover { color: #374151; }
.grid-view .grid-details { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.grid-address-info { display: flex; align-items: center; gap: 8px; color: #6b7280; font-size: 12px; margin-left:2px; }
.grid-address-info i { color: #ef4444; font-size: 16px; width: 16px; }
.results-list h1 { margin: 10px 0 15px; font-size: 25px; }

/* Mobile Responsive */
@media screen and (max-width: 480px) {
   #view-list-container { margin: 20px 0px 120px 0px; }
   .results-list{ padding:5px}
}

@media screen and (max-width: 768px) {
  .view-list-btn { font-size: 14px; height: 48px; min-width: 120px; padding: 0 20px; }
    .modern-content { padding: 15px; }
    .modern-results-header { padding: 20px; margin-bottom: 20px; border-radius: 20px; }
    .modern-page-title { font-size: 18px; margin-bottom: 15px; }
    .modern-results-bar { flex-direction: column; gap: 15px; padding: 20px; text-align: center; }
    .modern-pagination-wrapper { flex-direction: column; gap: 10px; }
    .layout-toggle-wrapper { order: -1; }
    .grid-result-item { grid-template-columns: 1fr; gap: 0; margin-bottom: 20px; }
    .grid-image { width: 100%; height: 220px; border-radius: 24px 24px 0 0; }
    .grid-content { padding: 20px; }
    .grid-title { font-size: 22px; }
    .large-list-item {
        grid-template-columns: 34% 1fr; gap: 8px; padding: 0px; border: 0px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); margin-bottom: 15px; border-radius: 10px; min-height: 140px;
    }
    .list-image { width: 100%; min-height: auto; overflow: hidden; flex-shrink: 0; }
    .list-content { padding: 12px 0px; gap: 0px; justify-content: flex-start; }
    .list-title { font-size: 15px !important; margin: 0px; line-height: 1.3; }
    .list-company-name { font-size: 12px; margin: 0 0 6px 0; opacity: 0.7; }
    .list-details { gap: 8px; }
    .list-address { font-size: 13px; line-height: 1.3; }
    .list-address i { font-size: 14px; width: 14px; }
    .gmap { font-size: 12px; padding: 6px 12px; border-radius: 8px; }
    .gmap i { font-size: 11px; }
    .gmap_gym_canvas { height: 250px; margin-top: 10px; border-radius: 12px; grid-column: 1 / -1; }
    .banner-content { flex-direction: column; gap: 15px; text-align: center; }
    .company-badge .company-logo { width: 80px; height: 80px; margin: 0 auto; }
    .modern-breadcrumbs { font-size: 12px; justify-content: center; }
}

/* Desktop Grid Layout */
@media screen and (min-width: 769px) {
    .grid-result-item { position: relative; }
    .grid-view .grid-result-item { height: 550px; display: flex; flex-direction: column; }
    .grid-view .grid-image { height: 250px; flex-shrink: 0; }
    .grid-view .grid-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
    .grid-view .overlay-map {
        display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%;
        z-index: 1000; background: rgba(255, 255, 255, 0.98); border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    }
    .grid-view .overlay-map.active { display: block; }
    .grid-view .grid-container { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 30px; }
    .list-view .large-list-item {
        grid-template-columns: 320px 1fr; gap: 0; min-height: 200px; border-radius: 20px; margin-bottom: 15px;
    }
    .list-view .list-image { width: 320px; height: 100%; min-height: 200px; }
    .list-view .list-content { padding: 25px 30px 25px 25px; }
    .list-view .list-title { font-size: 24px; margin: 0px; }
}

@media screen and (min-width: 1200px) {
    .grid-view .grid-container { grid-template-columns: repeat(3, 1fr); gap: 30px; }
}

/* Print styles */
@media print {
    .search-results { background: white; }
    .grid-result-item, .large-list-item { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    .modern-map-toggle, .gmap, .pagination-nav, .layout-toggle-buttons { display: none !important; }
}

/* Overlay close button */
.overlay-close-btn {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 1001;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; border: none;
    border-radius: 0 0 24px 24px; padding: 15px; height: 50px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%; opacity: 0; transform: translateY(20px); visibility: hidden;
}
.overlay-close-btn.active { opacity: 1; transform: translateY(0); visibility: visible; }
.overlay-close-btn:hover { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
