/* ==============================================
   JSHUK BUSINESSES PAGE STYLES
   Modern, responsive business directory interface
   ============================================== */

/* Hide ads on businesses page */
.businesses-page .footer-ad-container,
.businesses-page .sidebar-ad-container,
.businesses-page [class*="ad-"] {
    display: none !important;
}

/* ==============================================
   LAYOUT STRUCTURE
   ============================================== */

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

/*
 * =========================================
 * MAP VISIBILITY FIX - DISABLED (CONFLICTS WITH GRID LAYOUT)
 * =========================================
 * 
 * This flexbox layout conflicts with the CSS Grid layout in businesses.css
 * The grid layout is now the primary layout system.
 */

/* DISABLED - CONFLICTS WITH GRID LAYOUT
.tri-pane-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 120px);
    width: 100%;
    margin: 20px auto;
    max-width: 1400px;
    padding: 0 20px;
    gap: 20px;
}

.filter-column {
    flex-basis: 350px;
    flex-shrink: 0;
    overflow-y: auto;
}

.listings-column {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.map-column {
    flex-basis: 400px;
    flex-shrink: 0;
    position: relative;
    height: 100%;
}
END DISABLED SECTION */

/* REMOVED: Conflicting flexbox media queries
 * These conflict with the CSS Grid layout in css/pages/businesses.css
 * The responsive behavior is now handled by the grid layout system
 */

/* ==============================================
   FILTER SIDEBAR
   ============================================== */

.filter-column {
    position: relative;
}

.filter-sidebar {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-filters-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-filters-btn:hover {
    background: rgba(255,255,255,0.2);
}

.filter-sidebar-content {
    padding: 20px;
}

.filter-block {
    margin-bottom: 30px;
}

.filter-block h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.form-control, .form-select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    outline: none;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
}

.filter-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-outline-secondary {
    background: white;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* Mobile Filter Sidebar */
@media (max-width: 1200px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -350px;
        width: 350px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        max-height: none;
        border-radius: 0;
    }
    
    .filter-sidebar.is-open {
        left: 0;
    }
}

/* ==============================================
   LISTINGS COLUMN
   ============================================== */

/* NOTE: .listings-column styles are now defined in the MAP VISIBILITY FIX section above */

/* Mobile View Toggle */
.mobile-view-toggle {
    display: none;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .mobile-view-toggle {
        display: flex;
    }
}

.toggle-btn {
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.toggle-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toggle-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Results Header Controls */
.results-header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

.filter-trigger-btn {
    display: none;
    background: #007bff;
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
}

.filter-trigger-btn:hover {
    background: #0056b3;
}

@media (max-width: 1200px) {
    .filter-trigger-btn {
        display: flex;
    }
}

.results-summary {
    flex: 1;
}

.results-count {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-filter {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin-left: 5px;
}

.remove-filter:hover {
    color: #dc3545;
}

.view-controls {
    display: flex;
    gap: 5px;
}

@media (max-width: 768px) {
    .view-controls {
        display: none;
    }
}

.view-toggle-btn, .map-toggle-btn {
    padding: 10px;
    border: 2px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn.active, .map-toggle-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.view-toggle-btn:hover, .map-toggle-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sorting-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sorting-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sorting-form label {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.sorting-form select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* ==============================================
   BUSINESS CARDS
   ============================================== */

.business-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 20px;
}

@media (max-width: 768px) {
    .business-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
}

/* List View */
.business-results-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

.business-results-grid.list-view .business-card {
    display: flex;
    flex-direction: row;
    height: 200px;
}

.business-results-grid.list-view .image-container {
    width: 250px;
    height: 200px;
    flex-shrink: 0;
}

.business-results-grid.list-view .business-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.business-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    cursor: pointer;
}

.business-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e0e0e0;
}

.image-container {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    overflow: hidden;
    position: relative;
}

.business-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.business-card:hover .business-card-image {
    transform: scale(1.05);
}

.business-card-content {
    padding: 24px;
}

.business-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.3;
}

.business-category {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.business-category i {
    color: #95a5a6;
}

.business-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.business-rating .text-warning {
    color: #ffc107 !important;
}

.business-rating span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.business-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.business-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

/* Business Action Buttons */
.btn-view {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.btn-view:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
}

.btn-quick-view {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-quick-view:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.4);
}

.btn-favorite {
    background: white;
    color: #dc3545;
    padding: 12px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220,53,69,0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.btn-favorite.is-favorite {
    background: #dc3545;
    color: white;
}

/* ==============================================
   MAP COLUMN
   ============================================== */

.map-column {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.map-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-area-btn {
    background: #007bff;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-area-btn:hover {
    background: #0056b3;
}

/*
 * CRITICAL: Make the map canvas itself fill its parent container.
 * This is the rule that actually gives the map a height.
 */
#map-canvas {
    width: 100%;
    height: 100%; /* Fill the parent's height */
    min-height: 400px; /* Ensures a minimum height on all screens */
    background: #f8f9fa;
    position: relative; /* Required by Google Maps */
}

#map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248,249,250,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-weight: 500;
}

.loading-spinner i {
    font-size: 1.2rem;
}

/* ==============================================
   QUICK VIEW MODAL
   ============================================== */

.quick-view-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.quick-view-content {
    position: relative;
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quick-view-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.quick-view-close:hover {
    color: #000;
    background: white;
    transform: scale(1.1);
}

.quick-view-header {
    display: flex;
    padding: 30px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}

.quick-view-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
}

.quick-view-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-view-info {
    flex: 1;
}

.quick-view-info h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
}

.quick-view-category {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.quick-view-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.quick-view-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.quick-view-body h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.quick-view-description p {
    color: #555;
    line-height: 1.6;
    font-size: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.95rem;
}

.contact-item i {
    color: #007bff;
    width: 20px;
    text-align: center;
}

.contact-item a {
    color: #007bff;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.quick-view-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.btn-favorite-modal {
    background: white;
    color: #dc3545;
    padding: 12px 20px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-favorite-modal:hover {
    background: #dc3545;
    color: white;
}

.btn-favorite-modal.is-favorite {
    background: #dc3545;
    color: white;
}

.btn-view-full {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view-full:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */

@media (max-width: 768px) {
    .quick-view-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .quick-view-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quick-view-image {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .quick-view-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quick-view-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .results-header-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .business-footer {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ==============================================
   UTILITIES & HELPERS
   ============================================== */

.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Force visibility classes */
.force-visible {
    display: block !important;
}

.force-hidden {
    display: none !important;
}

/* Google Maps specific fixes */
.gm-style {
    width: 100% !important;
    height: 100% !important;
}

/* Toast notification styles */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
.btn:focus,
input:focus,
select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .business-card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
} 