/* --- ChargePress --- */
:root {
    /* Colors */
    --ev-primary: #5E42DA;
    /* Vibrant Purple */
    --ev-primary-hover: #4b32b8;
    --ev-secondary: #1F2937;
    /* Dark Gray */
    --ev-bg: #F9FAFB;
    --ev-surface: #FFFFFF;
    --ev-border: #E5E7EB;
    --ev-text-main: #111827;
    --ev-text-sub: #6B7280;

    /* Spacing */
    --ev-radius: 8px;
    --ev-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.ev-list-container {
    padding: 20px;
    background: transparent;
    /* Seamless integration */
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.ev-list-header {
    text-align: center;
    margin-bottom: 40px;
}

.ev-list-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--ev-text-main);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.ev-list-header p {
    color: var(--ev-text-sub);
    font-size: 18px;
}

/* Filters Bar - Modern Grid Layout */
.ev-filters {
    margin-bottom: 25px;
    padding: 25px;
    background: #fff;
    border-radius: var(--ev-radius);
    box-shadow: var(--ev-shadow);
}

.ev-filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ev-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    flex: 1;
}

.ev-filter-search-box {
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ev-filter-search-box label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ev-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ev-filter-search-box label .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--ev-primary);
}

.ev-filter-search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--ev-border);
    border-radius: var(--ev-radius);
    background: #FAFBFC;
    font-size: 14px;
    transition: all 0.2s;
    color: var(--ev-text-main);
    font-family: inherit;
}

.ev-filter-search-box input:focus {
    outline: none;
    border-color: var(--ev-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94, 66, 218, 0.08);
}

.ev-filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ev-filter-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ev-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ev-filter-item label .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--ev-primary);
}

.ev-filter-item input,
.ev-filter-item select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--ev-border);
    border-radius: var(--ev-radius);
    background: #FAFBFC;
    font-size: 14px;
    transition: all 0.2s;
    color: var(--ev-text-main);
}

.ev-filter-item input:focus,
.ev-filter-item select:focus {
    outline: none;
    border-color: var(--ev-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94, 66, 218, 0.08);
}

/* Filter Actions Row */
.ev-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--ev-border);
}

.ev-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ev-filter-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--ev-primary);
    padding: 6px 12px;
    background: #F3F0FF;
    border-radius: 20px;
}

.ev-btn-reset {
    background: transparent;
    color: var(--ev-text-sub);
    border: 1.5px solid var(--ev-border);
    padding: 8px 18px;
    border-radius: var(--ev-radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ev-btn-reset:hover {
    background: #FFF5F5;
    color: #DC2626;
    border-color: #FCA5A5;
}

.ev-btn-reset .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Old button styles for compatibility */.ev-btn-primary {
    background: var(--ev-primary);
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: var(--ev-radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ev-btn-primary:hover {
    background: var(--ev-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(94, 66, 218, 0.2);
}

.ev-btn-primary .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Cards */
.ev-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.ev-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--ev-shadow);
    transition: all 0.3s;
    overflow: hidden;
}

.ev-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.ev-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--ev-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ev-card-logo img {
    max-width: 80px;
    max-height: 50px;
    object-fit: contain;
}

.ev-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ev-text-main);
}

.ev-card-body {
    padding: 20px;
}

.ev-card-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.ev-card-row:last-child {
    border-bottom: none;
}

.ev-card-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--ev-text-sub);
}

.ev-card-value {
    font-size: 14px;
    color: var(--ev-text-main);
}

.ev-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #eef2ff;
    color: var(--ev-primary);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

/* Badge Styles for Access Type */
.ev-badge-purple {
    display: inline-block;
    padding: 5px 12px;
    background: #E8E3FF;
    color: #5E42DA;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.ev-badge-orange {
    display: inline-block;
    padding: 5px 12px;
    background: #FFF4E6;
    color: #F59E0B;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.ev-badge-gray-dark {
    display: inline-block;
    padding: 5px 12px;
    background: #F3F4F6;
    color: #6B7280;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.ev-badge-gray {
    display: inline-block;
    padding: 5px 12px;
    background: #F9FAFB;
    color: #6B7280;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #E5E7EB;
}

/* Detail Button - Purple Theme */
.ev-btn-detail {
    display: inline-block;
    padding: 8px 16px;
    background: var(--ev-primary);
    color: #FFFFFF;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ev-btn-detail:hover {
    background: var(--ev-primary-hover);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(94, 66, 218, 0.25);
}

/* Paginator - Modern Design */
.ev-paginator,
.ev-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px;
}

.ev-paginator a,
.ev-paginator span,
.ev-pagination a,
.ev-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1.5px solid var(--ev-border);
    border-radius: var(--ev-radius);
    color: var(--ev-text-main);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.ev-paginator a:hover,
.ev-pagination a:hover {
    background: #F3F0FF;
    border-color: var(--ev-primary);
    color: var(--ev-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(94, 66, 218, 0.1);
}

.ev-paginator .current,
.ev-pagination .current {
    background: var(--ev-primary);
    color: #fff;
    border-color: var(--ev-primary);
    cursor: default;
    box-shadow: 0 2px 8px rgba(94, 66, 218, 0.25);
}

.ev-paginator .dots,
.ev-pagination .dots {
    border: none;
    background: transparent;
    color: var(--ev-text-sub);
    cursor: default;
    min-width: auto;
}

.ev-paginator .prev,
.ev-paginator .next,
.ev-pagination .prev,
.ev-pagination .next {
    font-weight: 700;
    font-size: 16px;
}

/* Disabled state */
.ev-paginator a.disabled,
.ev-pagination a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Old button styles (legacy) */
.ev-paginator button {
    background: #fff;
    border: 1px solid var(--ev-border);
    padding: 10px 18px;
    margin: 0 4px;
    border-radius: var(--ev-radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.ev-paginator button:hover {
    background: #f9fafb;
    border-color: var(--ev-primary);
}

.ev-paginator button.active {
    background: var(--ev-primary);
    color: #fff;
    border-color: var(--ev-primary);
}

.ev-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ev-text-sub);
}

.ev-empty-state .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #ddd;
    margin-bottom: 15px;
}

.ev-empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.ev-empty-state p {
    font-size: 14px;
}

/* --- Map Container --- */
.ev-map-container {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: var(--ev-shadow);
}

/* Responsive */
@media (max-width: 768px) {
    .ev-filter-row {
        flex-direction: column;
    }
    
    .ev-filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ev-filter-search-box {
        min-width: 100%;
    }

    .ev-filter-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .ev-btn-reset {
        width: 100%;
        justify-content: center;
    }

    .ev-filters {
        flex-direction: column;
    }

    .ev-cards-grid {
        grid-template-columns: 1fr;
    }

    .ev-map-container {
        height: 400px;
    }

    .ev-list-header h2 {
        font-size: 28px;
    }

    /* Mobile friendly buttons */
    .ev-btn-primary {
        width: 100%;
        text-align: center;
    }
}

/* --- NEW PRICE TABLE STYLES --- */
.ev-price-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: transparent;
    /* Theme Compatible */
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    /* Allow sticky headers etc if needed */
    border: none;
    margin: 20px auto;
    max-width: 1400px;
    /* Limit table width on large screens */
}

.ev-filters-simple {
    padding: 20px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- SEARCH BOX IMPROVEMENTS --- */
.ev-search-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    width: 350px;
    min-width: 250px;
    position: relative;
}

.ev-search-box .dashicons {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #999;
    z-index: 5;
    font-size: 16px;
    width: 16px;
    height: 16px;
    font-family: dashicons !important;
}

#ev-price-search {
    max-width: 320px;
    height: 42px;
    padding: 0 15px 0 45px;
    border-radius: 25px;
    border: 1.5px solid #eaeaea;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

#ev-price-search:focus {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    outline: none;
}

#ev-price-search::placeholder {
    color: #999;
    font-weight: 400;
}

.ev-input-clean {
    width: 100%;
    padding: 12px 12px 12px 50px !important;
    /* Force extra space for icon */
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fdfdfd;
    line-height: normal;
    /* Fix for some themes */
}

.ev-input-clean:focus {
    border-color: var(--ev-primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(94, 66, 218, 0.1);
}

.ev-meta-info {
    font-size: 13px;
    color: #666;
}

.ev-table-container {
    overflow-x: auto;
}

/* Typography & Cells */
.ev-table th {
    background: transparent;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s, color 0.2s;
}

/* Sortable headers */
.ev-table th.ev-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 35px;
}

/* Sorting indicator */
.ev-table th.ev-sortable::after {
    content: "⇅";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-weight: normal;
    transition: opacity 0.2s, color 0.2s;
}

.ev-table th.ev-sortable:hover {
    background: rgba(94, 66, 218, 0.05);
    color: var(--ev-primary);
}

.ev-table th.ev-sortable:hover::after {
    opacity: 0.7;
    color: var(--ev-primary);
}

.ev-table th.ev-sortable.asc::after {
    content: "▲";
    opacity: 1;
    color: var(--ev-primary);
}

.ev-table th.ev-sortable.desc::after {
    content: "▼";
    opacity: 1;
    color: var(--ev-primary);
}

/* Row Height & Alignment */
.ev-table tbody tr {
    transition: all 0.2s ease;
    min-height: 60px; /* Reduced from 70px for compact look */
}

/* Zebra striping - alternating row colors */
.ev-table tbody tr:nth-child(even) {
    background: #FAFBFC;
}

.ev-table tbody tr:hover {
    background: #F3F0FF !important; /* Light purple on hover */
    box-shadow: 0 2px 8px rgba(94, 66, 218, 0.12);
    transform: translateY(-1px);
}

.ev-table td {
    padding: 12px 15px; /* Reduced from 16px for compact look */
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

.ev-table tbody tr:last-child td {
    border-bottom: none;
}

/* Result Count Header */
.ev-results-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    background: #FFFFFF;
    border: 1px solid var(--ev-border);
    border-bottom: none;
    border-radius: var(--ev-radius) var(--ev-radius) 0 0;
    margin-top: 20px;
}

.ev-result-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--ev-primary);
}

/* Loading Spinner */
#ev-loading {
    padding: 40px 20px;
    text-align: center;
}

.ev-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #F3F0FF;
    border-top: 4px solid var(--ev-primary);
    border-radius: 50%;
    animation: ev-spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes ev-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Adjust table wrapper when result header is visible */
.ev-results-header + .ev-table-wrapper .ev-table {
    border-radius: 0 0 var(--ev-radius) var(--ev-radius);
}

/* Logo and Company Name Container */
.ev-firm-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ev-logo-wrapper {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    min-height: 50px;
    padding: 8px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ev-logo,
.ev-firm-logo-img {
    max-width: 60px;
    max-height: 40px;
    object-fit: contain;
    display: block;
}

.ev-firm-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ev-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
}

.ev-firm-info {
    flex: 1;
}

.ev-firm-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ev-text-main);
    line-height: 1.3;
    text-decoration: none;
}

.ev-firm-name:hover {
    color: var(--ev-primary);
}

/* Mobile: Show only company name, hide logo */
@media screen and (max-width: 768px) {
    .ev-firm-flex .ev-logo-wrapper {
        display: none;
    }
    
    .ev-firm-flex .ev-firm-name {
        font-size: 18px;
        font-weight: 700;
    }
}


/* Price Display - CONSISTENCY FIXES */
.ev-price-single,
.ev-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    margin-bottom: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: fit-content;
    max-width: max-content;
    gap: 8px;
}

.ev-price-row:last-child,
.ev-price-single:last-child {
    margin-bottom: 0;
}

/* Price Text */
.ev-price-row strong,
.ev-price-single strong,
.ev-price-row span,
.ev-price-single span {
    font-weight: 600;
}

/* Empty Cell (Dash) */
.ev-dash {
    text-align: center;
    font-weight: 300;
    opacity: 0.5;
    font-size: 18px;
}

/* Badge/Tag Styles */
.ev-kw-badge,
.ev-kw-tag {
    background: #eef2ff;
    color: #5E42DA;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

/* Desktop Column Widths */
.ev-table th:nth-child(1) {
    width: 30%;
}

.ev-table th:nth-child(2) {
    width: 23%;
}

.ev-table th:nth-child(3) {
    width: 23%;
}

.ev-table th:nth-child(4) {
    width: 24%;
}

/* --- MOBILE RESPONSIVE (Card Layout) --- */
@media screen and (max-width: 768px) {

    /* Hide table headers */
    .ev-table thead {
        display: none;
    }

    /* Make table, tbody display as block */
    .ev-table,
    .ev-table tbody {
        display: block;
        width: 100%;
    }

    /* Transform rows into cards */
    .ev-table tr {
        display: block;
        background: #fff;
        margin-bottom: 16px;
        padding: 16px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* Make cells display as block */
    .ev-table td {
        display: block;
        padding: 12px 0;
        border: none;
        text-align: left;
    }

    /* Add labels using data-label */
    .ev-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        color: #6b7280;
        margin-bottom: 6px;
        letter-spacing: 0.05em;
    }

    /* First cell (logo) - no label needed */
    .ev-table td:first-child::before {
        content: "";
        display: none;
    }

    /* Logo styling for mobile cards */
    .ev-logo-wrapper {
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: none;
    }

    .ev-logo {
        max-width: 48px;
        max-height: 36px;
    }

    .ev-firm-name {
        font-size: 16px;
        font-weight: 700;
    }

    /* Price cells spacing */
    .ev-table td {
        padding: 10px 0;
    }

    /* Price rows in cards */
    .ev-price-row,
    .ev-price-single {
        margin-bottom: 4px;
        font-size: 14px;
        padding: 8px 12px;
    }

    /* Search box adjustments */
    .ev-filters-simple {
        flex-direction: column;
        align-items: stretch;
    }

    .ev-search-box {
        width: 100%;
        min-width: 100%;
    }

    #ev-price-search {
        max-width: 100%;
    }

    .ev-meta-info {
        text-align: center;
        margin-top: 10px;
    }
}

/* --- CONSISTENCY FIXES --- */
.ev-table td {
    height: 70px;
}

.ev-search-box span:not(.dashicons),
.ev-search-box {
    font-family: inherit;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}