/**
 * Find Training Page Styles
 *
 * Google Maps-style full-screen layout with sidebar and compact filter bar.
 *
 * @package HVAC_Community_Events
 * @since 2.2.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --hvac-header-offset: 0px;
    --hvac-primary: #00b3a4;
    --hvac-primary-dark: #009688;
    --hvac-secondary: #164B60;
    --hvac-secondary-dark: #1a5a73;
    --hvac-venue-color: #89c92e;
    --hvac-trainer-color: #f0f7e8;
    --hvac-event-color: #0ebaa6;
    --hvac-text: #333;
    --hvac-text-muted: #666;
    --hvac-border: #e0e0e0;
    --hvac-sidebar-width: 380px;
    --hvac-filter-bar-height: auto;
}

/* Astra theme header offset */
body:not(.ast-header-break-point) .hvac-find-training-page {
    --hvac-header-offset: 0px;
}

/* WordPress admin bar adjustment */
.admin-bar .hvac-find-training-page {
    --hvac-header-offset: 32px;
}

@media (max-width: 782px) {
    .admin-bar .hvac-find-training-page {
        --hvac-header-offset: 46px;
    }
}

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.hvac-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--hvac-secondary);
    color: #fff;
    padding: 8px 16px;
    z-index: 100000;
    transition: top 0.2s;
}

.hvac-skip-link:focus {
    top: 0;
    outline: 2px solid var(--hvac-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Page Layout - Full Height
   ========================================================================== */

.hvac-find-training-page {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important; /* Modern browsers - accounts for mobile browser UI */
    overflow: hidden !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove default Astra container constraints */
.hvac-find-training-page .ast-container,
.hvac-find-training-page > .ast-container,
body .hvac-find-training-page {
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

/* ==========================================================================
   Filter Bar - Fixed at Top
   ========================================================================== */

.hvac-filter-bar {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid var(--hvac-border);
    padding: 12px 16px;
    z-index: 100;
}

.hvac-filter-bar-inner {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
}

/* Search Input */
.hvac-filter-search {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 300px;
}

.hvac-filter-search .dashicons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.hvac-filter-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    font-size: 14px;
    border: 1px solid var(--hvac-border);
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hvac-filter-search input:focus {
    outline: none;
    border-color: var(--hvac-primary);
    box-shadow: 0 0 0 3px rgba(0, 179, 164, 0.15);
}

/* Filter Dropdowns */
.hvac-filter-dropdowns {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
}

.hvac-filter-select {
    padding: 10px 32px 10px 12px;
    font-size: 14px;
    border: 1px solid var(--hvac-border);
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    min-width: 130px;
    appearance: none;
}

.hvac-filter-select:focus {
    outline: none;
    border-color: var(--hvac-primary);
}

/* Near Me Button */
.hvac-near-me-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--hvac-secondary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.hvac-near-me-btn:hover {
    background: var(--hvac-secondary-dark);
}

.hvac-near-me-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hvac-near-me-btn.active {
    background: var(--hvac-primary);
}

.hvac-near-me-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Clear Filters Button */
.hvac-clear-filters {
    padding: 10px 14px;
    background: transparent;
    color: var(--hvac-primary);
    border: 1px solid var(--hvac-primary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.hvac-clear-filters:hover {
    background: var(--hvac-primary);
    color: #fff;
}

/* Mobile Filter Toggle - Hidden on Desktop */
.hvac-mobile-filter-toggle {
    display: none !important;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f5f5f5;
    color: var(--hvac-text);
    border: 1px solid var(--hvac-border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Sidebar Toggle - Hidden on Desktop */
.hvac-sidebar-toggle {
    display: none !important;
}

.hvac-mobile-filter-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Active Filters Chips */
.hvac-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.hvac-active-filters:empty {
    display: none;
}

.hvac-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #e8f5f4;
    color: #00736a;
    border-radius: 20px;
    font-size: 13px;
}

.hvac-active-filter button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    opacity: 0.7;
}

.hvac-active-filter button:hover {
    opacity: 1;
}

/* Mobile Filter Panel */
.hvac-mobile-filter-panel {
    display: none;
    padding: 16px 0;
    border-top: 1px solid var(--hvac-border);
    margin-top: 12px;
}

.hvac-mobile-filter-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hvac-mobile-filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--hvac-text-muted);
    margin-bottom: 6px;
}

.hvac-mobile-filter-group .hvac-filter-select {
    width: 100%;
}

/* ==========================================================================
   Main Layout - CSS Grid for Sidebar + Map
   ========================================================================== */

.hvac-map-layout {
    flex: 1 !important;
    display: grid !important;
    grid-template-areas: "sidebar map" !important;
    grid-template-columns: var(--hvac-sidebar-width) 1fr !important;
    overflow: hidden !important;
    min-height: 0 !important; /* Prevent grid blowout */
}

/* ==========================================================================
   Left Sidebar
   ========================================================================== */

.hvac-sidebar {
    grid-area: sidebar !important;
    background: #fff;
    border-right: 1px solid var(--hvac-border);
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    width: var(--hvac-sidebar-width) !important;
}

.hvac-sidebar-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--hvac-border);
}

.hvac-results-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--hvac-secondary);
}

.hvac-results-summary #hvac-trainer-count {
    font-size: 18px;
}

/* Sidebar Toggle styling (visibility controlled by media queries) */
.hvac-sidebar-toggle.hvac-sidebar-toggle {
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.hvac-sidebar-toggle:hover {
    background: #eee;
}

.hvac-sidebar-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--hvac-text-muted);
    transition: transform 0.2s;
}

.hvac-sidebar.collapsed .hvac-sidebar-toggle .dashicons {
    transform: rotate(180deg);
}

/* Sidebar Content - Scrollable */
.hvac-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Trainer List */
.hvac-trainer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loading State */
.hvac-grid-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--hvac-text-muted);
}

.hvac-spin {
    animation: hvac-spin 1s linear infinite;
}

@keyframes hvac-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Trainer Card - Compact for Sidebar */
.hvac-trainer-card {
    background: #fff;
    border: 1px solid var(--hvac-border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    gap: 12px;
}

.hvac-trainer-card:hover {
    border-color: var(--hvac-primary);
    box-shadow: 0 2px 8px rgba(0, 179, 164, 0.15);
}

/* Champion Cards - Non-clickable appearance (Champions don't offer public training) */
.hvac-champion-card {
    cursor: default;
    opacity: 0.9;
}

.hvac-champion-card:hover {
    border-color: var(--hvac-border);
    box-shadow: none;
    transform: none;
}

.hvac-trainer-card-image {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    position: relative;
}

.hvac-trainer-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.hvac-trainer-card-avatar {
    width: 100%;
    height: 100%;
    background: #e8f5f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hvac-trainer-card-avatar .dashicons {
    font-size: 24px;
    color: var(--hvac-primary);
}

.hvac-mq-badge-small {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
}

.hvac-trainer-card-info {
    flex: 1;
    min-width: 0;
}

.hvac-trainer-card-name {
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 3px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvac-trainer-card-location {
    color: var(--hvac-text-muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.hvac-trainer-card-certs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hvac-cert-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #e8f5f4;
    color: #00736a;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

/* No Results */
.hvac-no-results {
    text-align: center;
    padding: 30px 20px;
    color: var(--hvac-text-muted);
}

/* Load More Button */
.hvac-load-more-wrapper {
    text-align: center;
    padding-top: 8px;
}

#hvac-load-more {
    width: 100%;
}

/* Sidebar CTA */
.hvac-sidebar-cta {
    margin-top: auto;
    padding: 16px;
    background: #f8fafa;
    border-radius: 8px;
    text-align: center;
}

.hvac-sidebar-cta p {
    font-size: 14px;
    color: var(--hvac-text);
    margin: 0 0 12px;
}

.hvac-btn-small {
    padding: 10px 20px;
    font-size: 14px;
}

/* ==========================================================================
   Map Container
   ========================================================================== */

.hvac-map-container {
    grid-area: map;
    position: relative;
    min-height: 0; /* Prevent grid blowout */
}

.hvac-google-map {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

/* Override global img { max-width: 100% } from theme/WP that shrinks
   Google Maps tile images, causing markers to drift from tiles on zoom.
   See: https://developers.google.com/maps/documentation/javascript/best-practices */
#hvac-training-map img,
#hvac-training-map .gm-style img {
    max-width: none !important;
    max-height: none !important;
}

/* Map Loading State */
.hvac-map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--hvac-text-muted);
}

.hvac-map-loading .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    color: var(--hvac-primary);
}

/* Map Error State */
.hvac-map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--hvac-text-muted);
    text-align: center;
    padding: 30px;
}

.hvac-map-error .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    color: #e57373;
}

.hvac-map-error a {
    color: var(--hvac-primary);
}

/* Map Legend Overlay */
.hvac-map-legend {
    position: absolute;
    bottom: 24px;
    left: 12px;
    display: flex;
    gap: 16px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    z-index: 10;
}

.hvac-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hvac-text);
}

.hvac-legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.hvac-legend-trainer {
    background: var(--hvac-trainer-color);
    border: 2px solid #5a8a1a;
}

.hvac-legend-venue {
    background: var(--hvac-venue-color);
}

.hvac-legend-event {
    background: var(--hvac-event-color);
}

/* Reset Map View Button */
.hvac-reset-map-btn {
    position: absolute;
    bottom: 24px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.hvac-reset-map-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hvac-reset-map-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--hvac-text-muted);
}

/* Map Toggles Overlay */
.hvac-map-toggles {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.hvac-toggle-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--hvac-text);
}

.hvac-toggle-compact input {
    width: 16px;
    height: 16px;
    accent-color: var(--hvac-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.hvac-btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: var(--hvac-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.hvac-btn-primary:hover {
    background: var(--hvac-primary-dark);
    color: #fff;
}

.hvac-btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: #fff;
    color: var(--hvac-secondary);
    border: 2px solid var(--hvac-secondary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.hvac-btn-secondary:hover {
    background: var(--hvac-secondary);
    color: #fff;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.hvac-training-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hvac-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hvac-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hvac-modal-loading {
    padding: 60px;
    text-align: center;
    color: var(--hvac-text-muted);
}

.hvac-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hvac-modal-close:hover {
    background: #eee;
}

/* Trainer Modal Content */
.hvac-training-modal-header {
    padding: 24px 24px 0;
}

.hvac-training-modal-header h2 {
    color: var(--hvac-secondary);
    font-size: 1.5rem;
    margin: 0;
    padding-right: 40px;
}

.hvac-training-modal-body {
    padding: 24px;
}

.hvac-training-profile-section {
    margin-bottom: 24px;
}

.hvac-training-profile-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.hvac-training-profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.hvac-training-profile-avatar {
    width: 100px;
    height: 100px;
    background: #e8f5f4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hvac-training-profile-avatar .dashicons {
    font-size: 48px;
    color: var(--hvac-primary);
}

.hvac-training-profile-info {
    flex: 1;
}

.hvac-training-location {
    color: var(--hvac-text-muted);
    margin-bottom: 8px;
}

.hvac-training-certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.hvac-training-company {
    color: #555;
    margin-bottom: 8px;
}

.hvac-training-events-count {
    color: var(--hvac-text);
}

.hvac-training-detail {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.hvac-training-events {
    margin-top: 20px;
}

.hvac-training-events h4 {
    color: var(--hvac-secondary);
    margin-bottom: 12px;
}

.hvac-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hvac-events-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.hvac-events-list li:last-child {
    border-bottom: none;
}

.hvac-events-list a {
    color: var(--hvac-primary);
    text-decoration: none;
}

.hvac-events-list a:hover {
    text-decoration: underline;
}

.hvac-event-date {
    display: block;
    font-size: 13px;
    color: var(--hvac-text-muted);
    margin-top: 2px;
}

/* Contact Form in Modal */
.hvac-training-contact-section {
    border-top: 1px solid #eee;
    padding-top: 24px;
}

.hvac-training-contact-section h4 {
    color: var(--hvac-secondary);
    margin-bottom: 16px;
}

.hvac-training-contact-form .hvac-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.hvac-training-contact-form .hvac-form-field {
    margin-bottom: 12px;
}

.hvac-training-contact-form input,
.hvac-training-contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.hvac-training-contact-form input:focus,
.hvac-training-contact-form textarea:focus {
    outline: none;
    border-color: var(--hvac-primary);
}

.hvac-form-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
}

.hvac-form-success {
    background: #d4edda;
    color: #155724;
}

.hvac-form-error {
    background: #f8d7da;
    color: #721c24;
}

/* Venue Modal */
.hvac-venue-modal-header {
    padding: 24px 24px 0;
}

.hvac-venue-modal-header h2 {
    color: var(--hvac-secondary);
    font-size: 1.5rem;
    margin: 0;
    padding-right: 40px;
}

.hvac-venue-modal-body {
    padding: 24px;
}

.hvac-venue-address {
    color: var(--hvac-text-muted);
    margin-bottom: 20px;
}

.hvac-venue-events h4 {
    color: var(--hvac-secondary);
    margin-bottom: 12px;
}

.hvac-venue-events-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.hvac-venue-events-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.hvac-venue-directions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Google Maps Info Windows
   ========================================================================== */

.hvac-info-window {
    padding: 12px;
    max-width: 280px;
}

.hvac-info-window-title {
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 6px;
    font-size: 15px;
}

.hvac-info-window-location {
    color: var(--hvac-text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.hvac-info-window-cert {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f5f4;
    color: #00736a;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.hvac-info-window-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--hvac-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.hvac-info-window-btn:hover {
    background: var(--hvac-primary-dark);
}

/* Venue Info Window */
.hvac-info-window-venue {
    padding: 12px;
    max-width: 250px;
}

.hvac-info-window-address {
    color: var(--hvac-text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.hvac-info-window-events-count {
    font-size: 13px;
    color: #00736a;
    margin-bottom: 10px;
}

/* Event Info Window */
.hvac-info-window-event {
    padding: 12px;
    max-width: 280px;
}

.hvac-info-window-event .hvac-info-window-title {
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 6px;
    font-size: 15px;
}

.hvac-info-window-date {
    color: var(--hvac-text);
    font-size: 13px;
    margin-bottom: 4px;
}

.hvac-info-window-date .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
    color: var(--hvac-event-color);
}

.hvac-info-window-venue-name {
    color: var(--hvac-text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.hvac-info-window-cost {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f5f4;
    color: #00736a;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.hvac-info-window-cost.hvac-free {
    background: #d1fae5;
    color: #065f46;
}

.hvac-info-window-past-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
}

.hvac-info-window-event-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--hvac-event-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.hvac-info-window-event-link:hover {
    background: #0ca696;
    color: #fff;
}

/* Filter checkbox for Include Past Events */
.hvac-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--hvac-text);
    cursor: pointer;
    white-space: nowrap;
}

.hvac-filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--hvac-event-color);
}

/* ==========================================================================
   Location Error Message
   ========================================================================== */

.hvac-location-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.875rem;
}

.hvac-location-error .dashicons {
    color: #dc2626;
    flex-shrink: 0;
}

.hvac-location-error .hvac-dismiss-error {
    margin-left: auto;
    background: none;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.hvac-location-error .hvac-dismiss-error:hover {
    opacity: 1;
}

/* ==========================================================================
   Tablet Responsive (768px - 991px)
   ========================================================================== */

@media (max-width: 991px) {
    :root {
        --hvac-sidebar-width: 320px;
    }

    /* On mobile/tablet, allow natural page scrolling instead of fixed viewport */
    .hvac-find-training-page {
        height: auto !important;
        overflow: visible !important;
    }

    /* Keep filter bar visible while scrolling */
    .hvac-filter-bar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .admin-bar .hvac-filter-bar {
        top: 46px;
    }

    /* Switch to stacked layout - map on top, sidebar below */
    .hvac-map-layout {
        grid-template-areas:
            "map"
            "sidebar" !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 55vh auto !important;
        overflow: visible !important;
    }

    /* Map needs explicit height since page no longer constrains it */
    .hvac-map-container {
        min-height: 300px;
    }

    .hvac-sidebar {
        border-right: none;
        border-top: 1px solid var(--hvac-border);
        overflow-x: hidden !important;
        overflow-y: visible !important;
        max-height: none !important;
    }

    /* Sidebar content scrolls with page, not independently */
    .hvac-sidebar-content {
        overflow-y: visible !important;
    }

    /* Show sidebar toggle on tablet/mobile */
    .hvac-sidebar-toggle {
        display: flex !important;
    }

    /* Collapsible sidebar */
    .hvac-sidebar.collapsed {
        max-height: 80px;
        overflow: hidden !important;
    }

    .hvac-sidebar.collapsed .hvac-sidebar-content {
        display: none;
    }

    /* Hide filter dropdowns, show toggle */
    .hvac-filter-dropdowns {
        display: none !important;
    }

    .hvac-mobile-filter-toggle {
        display: flex !important;
    }

    /* Override sidebar width for tablet/mobile */
    .hvac-sidebar {
        width: 100% !important;
    }

    /* Adjust map overlays */
    .hvac-map-legend {
        bottom: 12px;
        left: 8px;
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Tabs on tablet */
    .hvac-sidebar-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hvac-sidebar-tabs {
        flex: 1;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .hvac-tab {
        padding: 8px 4px;
        font-size: 12px;
    }

    .hvac-marker-checkbox {
        width: 12px;
        height: 12px;
    }

    .hvac-marker-checkbox::after {
        left: 2px;
        top: 0px;
        width: 3px;
        height: 6px;
    }

    .hvac-marker-toggle {
        margin-right: 2px;
    }
}

/* ==========================================================================
   Mobile Responsive (<768px)
   ========================================================================== */

@media (max-width: 767px) {
    .hvac-map-layout {
        grid-template-rows: 50vh auto;
    }

    /* Filter bar adjustments */
    .hvac-filter-bar {
        padding: 10px 12px;
    }

    .hvac-filter-bar-inner {
        gap: 8px;
    }

    .hvac-filter-search {
        min-width: 0;
        max-width: none;
        flex: 1;
    }

    .hvac-filter-search input {
        padding: 8px 10px 8px 34px;
        font-size: 14px;
    }

    .hvac-near-me-btn {
        padding: 8px 12px;
    }

    .hvac-near-me-btn .hvac-btn-text {
        display: none;
    }

    .hvac-mobile-filter-toggle {
        padding: 8px 12px;
    }

    .hvac-mobile-filter-toggle .hvac-btn-text {
        display: none;
    }

    .hvac-clear-filters {
        padding: 8px 12px;
        font-size: 13px;
    }

    .hvac-info-btn {
        width: 32px;
        height: 32px;
    }

    /* Sidebar adjustments */
    .hvac-sidebar-header {
        padding: 10px 12px;
    }

    .hvac-sidebar-content {
        padding: 12px;
    }

    /* Tab adjustments */
    .hvac-sidebar-tabs {
        margin: 0 -12px;
        padding: 0 12px;
    }

    .hvac-tab {
        padding: 6px 2px;
        font-size: 11px;
    }

    .hvac-marker-toggle {
        display: none;
    }

    .hvac-trainer-card,
    .hvac-venue-card,
    .hvac-event-card {
        padding: 12px;
    }

    .hvac-trainer-card-image,
    .hvac-venue-card-icon,
    .hvac-event-card-date {
        width: 44px;
        height: 44px;
    }

    .hvac-trainer-card-name,
    .hvac-venue-card-name,
    .hvac-event-card-title {
        font-size: 13px;
    }

    .hvac-trainer-card-location,
    .hvac-venue-card-location,
    .hvac-event-card-venue {
        font-size: 11px;
    }

    .hvac-event-card-month {
        font-size: 9px;
    }

    .hvac-event-card-day {
        font-size: 16px;
    }

    /* Modal adjustments */
    .hvac-modal-content {
        max-height: 85vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }

    .hvac-training-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hvac-training-contact-form .hvac-form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Small Mobile (<480px)
   ========================================================================== */

@media (max-width: 480px) {
    .hvac-map-layout {
        grid-template-rows: 45vh auto;
    }

    .hvac-map-legend {
        flex-direction: column;
        gap: 6px;
        bottom: 8px;
        left: 6px;
        padding: 6px 10px;
    }

    .hvac-map-toggles {
        flex-direction: column;
        gap: 4px;
        top: 6px;
        left: 6px;
        padding: 6px 10px;
    }
}

/* ==========================================================================
   Equipment & Amenities Badges
   ========================================================================== */

.hvac-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.hvac-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.hvac-badge-equipment {
    background: #e6f7f5;
    color: #00736a;
    border: 1px solid #00a89d;
}

.hvac-badge-amenity {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

/* ==========================================================================
   Enhanced Venue Modal
   ========================================================================== */

.hvac-venue-modal-content {
    max-width: 600px;
}

.hvac-venue-phone,
.hvac-venue-capacity {
    color: var(--hvac-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.hvac-venue-description {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--hvac-text);
}

.hvac-venue-equipment,
.hvac-venue-amenities {
    margin-bottom: 20px;
}

.hvac-venue-equipment h4,
.hvac-venue-amenities h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 10px;
}

.hvac-venue-actions {
    margin-bottom: 24px;
}

.hvac-venue-no-events {
    color: var(--hvac-text-muted);
    font-style: italic;
    margin-bottom: 20px;
}

/* ==========================================================================
   Venue Contact Form
   ========================================================================== */

.hvac-venue-contact-section {
    border-top: 1px solid #eee;
    padding-top: 24px;
    margin-top: 24px;
}

.hvac-venue-contact-section h4 {
    color: var(--hvac-secondary);
    margin-bottom: 16px;
    font-size: 16px;
}

.hvac-venue-contact-form .hvac-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.hvac-venue-contact-form .hvac-form-group {
    margin-bottom: 12px;
}

.hvac-venue-contact-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--hvac-text);
    margin-bottom: 4px;
}

.hvac-venue-contact-form label .required {
    color: #dc2626;
}

.hvac-venue-contact-form input,
.hvac-venue-contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s;
}

.hvac-venue-contact-form input:focus,
.hvac-venue-contact-form textarea:focus {
    outline: none;
    border-color: var(--hvac-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 157, 0.1);
}

.hvac-venue-contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

.hvac-venue-contact-form button[type="submit"] {
    width: 100%;
    margin-top: 8px;
}

.hvac-venue-contact-section .hvac-form-success,
.hvac-venue-contact-section .hvac-form-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.hvac-venue-contact-section .hvac-form-success {
    background: #d1fae5;
    color: #065f46;
}

.hvac-venue-contact-section .hvac-form-error {
    background: #fee2e2;
    color: #991b1b;
}

.hvac-venue-contact-section .hvac-form-success .dashicons,
.hvac-venue-contact-section .hvac-form-error .dashicons {
    font-size: 24px;
    margin-top: 2px;
}

.hvac-venue-contact-section .hvac-form-success p,
.hvac-venue-contact-section .hvac-form-error p {
    margin: 0;
    font-size: 14px;
}

/* Responsive venue contact form */
@media (max-width: 600px) {
    .hvac-venue-contact-form .hvac-form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   reCAPTCHA Widget Styles
   ========================================================================== */

.hvac-recaptcha-wrapper {
    margin: 16px 0;
}

/* Ensure reCAPTCHA widget fits in narrow modal/form containers */
.hvac-recaptcha-wrapper .g-recaptcha {
    transform-origin: left top;
}

.hvac-training-contact-form .hvac-recaptcha-wrapper,
.hvac-venue-contact-form .hvac-recaptcha-wrapper {
    margin: 12px 0;
}

/* Scale down reCAPTCHA on very narrow screens */
@media (max-width: 400px) {
    .hvac-recaptcha-wrapper .g-recaptcha {
        transform: scale(0.9);
        margin-right: -30px;
    }
}

/* Scale for very narrow modals */
@media (max-width: 340px) {
    .hvac-recaptcha-wrapper .g-recaptcha {
        transform: scale(0.77);
        margin-right: -70px;
    }
}

/* ==========================================================================
   Sidebar Tabs
   ========================================================================== */

.hvac-sidebar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.hvac-sidebar-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--hvac-border);
    margin: 0 -16px;
    padding: 0 16px;
    overflow: hidden;
}

.hvac-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--hvac-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvac-tab:hover {
    color: var(--hvac-secondary);
    background: #f5f5f5;
}

.hvac-tab.active {
    color: var(--hvac-primary);
    border-bottom-color: var(--hvac-primary);
}

.hvac-tab:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 179, 164, 0.3);
}

.hvac-tab [data-count] {
    font-weight: 600;
}

/* Marker Toggle Checkboxes (inline in tab buttons) */
.hvac-marker-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: middle;
    position: relative;
}

.hvac-marker-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hvac-marker-checkbox {
    width: 14px;
    height: 14px;
    border: 2px solid #999;
    border-radius: 3px;
    display: inline-block;
    position: relative;
    transition: all 0.15s ease;
    background: #fff;
    flex-shrink: 0;
}

.hvac-marker-checkbox::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.hvac-marker-toggle input:checked + .hvac-marker-checkbox::after {
    opacity: 1;
}

/* Category-specific checkbox colors */
.hvac-marker-toggle-trainer input:checked + .hvac-marker-checkbox {
    background: #6aad1e;
    border-color: #6aad1e;
}

.hvac-marker-toggle-venue input:checked + .hvac-marker-checkbox {
    background: var(--hvac-venue-color);
    border-color: var(--hvac-venue-color);
}

.hvac-marker-toggle-event input:checked + .hvac-marker-checkbox {
    background: var(--hvac-event-color);
    border-color: var(--hvac-event-color);
}

.hvac-marker-toggle:hover .hvac-marker-checkbox {
    border-color: #666;
}

/* Tab Panels */
.hvac-tab-panel {
    display: none;
}

.hvac-tab-panel.active {
    display: block;
}

.hvac-item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================================
   Venue Cards
   ========================================================================== */

.hvac-venue-card {
    background: #fff;
    border: 1px solid var(--hvac-border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    gap: 12px;
}

.hvac-venue-card:hover {
    border-color: var(--hvac-venue-color);
    box-shadow: 0 2px 8px rgba(137, 201, 46, 0.15);
}

.hvac-venue-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #f0f9e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hvac-venue-card-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--hvac-venue-color);
}

.hvac-venue-card-info {
    flex: 1;
    min-width: 0;
}

.hvac-venue-card-name {
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 3px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvac-venue-card-location {
    color: var(--hvac-text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.hvac-venue-card-events {
    font-size: 12px;
    color: var(--hvac-venue-color);
    font-weight: 500;
}

/* ==========================================================================
   Event Cards
   ========================================================================== */

.hvac-event-card {
    background: #fff;
    border: 1px solid var(--hvac-border);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    gap: 12px;
}

.hvac-event-card:hover {
    border-color: var(--hvac-event-color);
    box-shadow: 0 2px 8px rgba(14, 186, 166, 0.15);
}

.hvac-event-card.hvac-event-past {
    opacity: 0.7;
}

.hvac-event-card-date {
    width: 48px;
    flex-shrink: 0;
    background: var(--hvac-event-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: #fff;
}

.hvac-event-card.hvac-event-past .hvac-event-card-date {
    background: #9ca3af;
}

.hvac-event-card-month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvac-event-card-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.hvac-event-card-info {
    flex: 1;
    min-width: 0;
}

.hvac-event-card-title {
    font-weight: 600;
    color: var(--hvac-secondary);
    margin-bottom: 3px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hvac-event-card-venue {
    color: var(--hvac-text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.hvac-event-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hvac-event-card-cost {
    font-size: 12px;
    font-weight: 600;
    color: var(--hvac-primary);
}

.hvac-event-card-cost.hvac-free {
    color: #059669;
}

.hvac-event-card-past-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 3px;
    font-weight: 500;
}

/* ==========================================================================
   Info Button & Modal
   ========================================================================== */

.hvac-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: 1px solid var(--hvac-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hvac-info-btn:hover {
    background: var(--hvac-primary);
    border-color: var(--hvac-primary);
    color: #fff;
}

.hvac-info-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--hvac-text-muted);
}

.hvac-info-btn:hover .dashicons {
    color: #fff;
}

/* Info Modal Content */
.hvac-info-modal-content {
    max-width: 560px;
}

.hvac-info-modal-header {
    padding: 24px 24px 0;
    position: relative;
}

.hvac-info-modal-header h2 {
    color: var(--hvac-secondary);
    font-size: 1.5rem;
    margin: 0;
    padding-right: 40px;
}

.hvac-info-modal-body {
    padding: 24px;
}

.hvac-info-section {
    margin-bottom: 24px;
}

.hvac-info-section:last-child {
    margin-bottom: 0;
}

.hvac-info-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hvac-secondary);
    margin: 0 0 12px;
}

.hvac-info-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--hvac-text);
    margin: 0;
}

.hvac-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hvac-info-list li {
    font-size: 14px;
    line-height: 1.5;
    color: var(--hvac-text);
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.hvac-info-list li:last-child {
    border-bottom: none;
}

.hvac-info-list li strong {
    color: var(--hvac-secondary);
}

/* Info Modal Legend */
.hvac-info-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hvac-info-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.hvac-info-legend-item .hvac-legend-marker {
    margin-top: 4px;
    flex-shrink: 0;
}

.hvac-info-legend-item strong {
    display: block;
    font-size: 14px;
    color: var(--hvac-secondary);
    margin-bottom: 2px;
}

.hvac-info-legend-item p {
    font-size: 13px;
    color: var(--hvac-text-muted);
    margin: 0;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.hvac-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--hvac-text-muted);
}

.hvac-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 12px;
}

.hvac-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .hvac-find-training-page {
        height: auto;
        overflow: visible;
    }

    .hvac-filter-bar,
    .hvac-map-container,
    .hvac-sidebar-toggle,
    .hvac-load-more-wrapper,
    .hvac-sidebar-cta {
        display: none;
    }

    .hvac-map-layout {
        display: block;
    }

    .hvac-sidebar {
        max-height: none;
        border: none;
    }

    .hvac-trainer-card {
        break-inside: avoid;
    }
}
