/* Map Styles */
.acf-map {
    width: 100%;
    height: 400px;
    border: 1px solid #9eafa2;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(1, 31, 0, 0.1);
}

/* Fixes potential theme css conflict */
.acf-map img {
   max-width: inherit !important;
}

/* Info Window Styles */
.rep-info-window {
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

.rep-info-window h3 {
    margin: 0 0 12px 0;
    color: #001f00;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #16A44A;
    padding-bottom: 8px;
}

.rep-info-window p {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #001f00;
}

.rep-info-window strong {
    color: #096a35;
    font-weight: 600;
}

.rep-info-window a {
    color: #096a35;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.rep-info-window a:hover {
    color: #16A44A;
    text-decoration: underline;
}

/* Container Styles */
.representatives-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Directory Styles */
.representatives-directory {
    margin-top: 50px;
}

.directory-header {
    margin-bottom: 35px;
}

.directory-header h2 {
    margin: 0 0 25px 0;
    font-size: 32px;
    font-weight: 700;
    color: #001f00;
    border-bottom: 3px solid #16A44A;
    padding-bottom: 12px;
    position: relative;
}

.directory-header h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #fccb0b;
}

/* Directory Controls */
.directory-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px;
}

.search-filter,
.country-filter {
    position: relative;
}

.search-filter input,
.country-filter select {
    padding: 14px 18px;
    border: 2px solid #9eafa2;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    min-width: 220px;
    background: #f7f8f9;
    color: #001f00;
    transition: all 0.3s ease;
}

.search-filter input:focus,
.country-filter select:focus {
    outline: none;
    border-color: #16A44A;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 164, 74, 0.1);
}

.search-filter input::placeholder {
    color: #9eafa2;
}

/* Representatives Grid */
.representatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

/* Representative Cards */
.rep-card {
    background: linear-gradient(135deg, #ffffff 0%, #f7f8f9 100%);
    border: 1px solid #9eafa2;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(1, 31, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rep-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #16A44A 0%, #096a35 50%, #fccb0b 100%);
}

.rep-card:hover {
    box-shadow: 0 8px 25px rgba(1, 31, 0, 0.15);
    transform: translateY(-4px);
    border-color: #16A44A;
}

/* Card Header */
.rep-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    gap: 15px;
}

.rep-card-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #001f00;
    line-height: 1.3;
    flex: 1;
}

.country-badge {
    background: linear-gradient(135deg, #16A44A 0%, #096a35 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(22, 164, 74, 0.3);
}

/* Card Content */
.rep-card-content {
    display: flex;
    flex-direction: column;
    gap:2px;
}

.address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.6;
    font-size: 15px;
}

.address .icon {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Contact Info */

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-item a {
    color: #096a35;
    text-decoration: underline;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.contact-item a:hover {
    color: #16A44A;
    text-decoration: underline;
}

/* Icons */
.icon {
    color: #9eafa2;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.contact-item:hover .icon {
    color: #16A44A;
}

/* Locate on Map Button */
.locate-on-map {
    background: linear-gradient(135deg, #f7f8f9 0%, #f0f0f0 100%);
    border: 2px solid #9eafa2;
    color: #096a35;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.locate-on-map:hover {
    background: linear-gradient(135deg, #16A44A 0%, #096a35 100%);
    border-color: #16A44A;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 164, 74, 0.3);
}

.locate-on-map:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(22, 164, 74, 0.3);
}

.locate-on-map .icon {
    transition: all 0.3s ease;
}

.locate-on-map:hover .icon {
    color: #ffffff;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9eafa2;
    font-style: italic;
    font-size: 18px;
    background: #f7f8f9;
    border-radius: 12px;
    border: 2px dashed #9eafa2;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .representatives-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 25px;
    }

    .rep-card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .representatives-container {
        padding: 0 15px;
    }

    .acf-map {
        height: 300px;
        margin: 15px 0;
        border-radius: 8px;
    }

    .directory-header h2 {
        font-size: 28px;
    }

    .directory-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .search-filter input,
    .country-filter select {
        min-width: 100%;
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .representatives-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rep-card {
        padding: 20px;
    }

    .rep-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .rep-card-header h3 {
        font-size: 20px;
    }

    .country-badge {
        align-self: flex-start;
    }

    .contact-info {
        gap: 10px;
    }

    .locate-on-map {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .representatives-container {
        padding: 0 10px;
    }

    .acf-map {
        height: 250px;
        margin: 10px 0;
    }

    .directory-header {
        margin-bottom: 25px;
    }

    .directory-header h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .rep-card {
        padding: 18px;
        border-radius: 12px;
    }

    .rep-card-header h3 {
        font-size: 18px;
    }

    .search-filter input,
    .country-filter select {
        padding: 10px 14px;
        font-size: 16px;
    }

    .contact-item a {
        font-size: 14px;
    }

    .address {
        font-size: 14px;
    }

    .locate-on-map {
        padding: 8px 14px;
        font-size: 12px;
        letter-spacing: 0.3px;
    }

    .no-results {
        padding: 40px 15px;
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .acf-map,
    .directory-controls,
    .locate-on-map {
        display: none;
    }

    .representatives-grid {
        display: block;
    }

    .rep-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #9eafa2;
    }

    .rep-card:hover {
        transform: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .rep-card,
    .locate-on-map,
    .search-filter input,
    .country-filter select,
    .contact-item a {
        transition: none;
    }

    .rep-card:hover {
        transform: none;
    }

    .locate-on-map:hover {
        transform: none;
    }
}

/* Focus Styles for Better Accessibility */
.locate-on-map:focus,
.search-filter input:focus,
.country-filter select:focus {
    outline: 3px solid #fccb0b;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .rep-card {
        border-width: 2px;
    }

    .country-badge {
        border: 2px solid #001f00;
    }

    .locate-on-map {
        border-width: 3px;
    }
}

