/* Legacy Admin Styles */
.wpkunaki_import tr td input,
.wpkunaki_import tr td select {
    font-size: 10px;
}

.wpkunaki_import .alt {
    background-color: #ccc;
}

#wpkunaki_table {
    max-height: 300px;
    overflow: auto;
}

#wpkunaki_table label {
    cursor: pointer;
}

#wpkunaki_table th {
    text-align: left;
}

#wpkunaki_table td {
    padding: 3px;
    border: #cccccc solid 1px;
}

#wpkunaki_table tr.selected {
    background-color: #eeeeff;
}

#wpkunaki_table input {
    font-family: Arial !important;
    font-size: 12px;
}

/* Icon Styles */
i.wpkunaki-icon,
.mce-i-wpkunaki-icon {
    background-image: url(wpkunaki-icon.png);
}

button#TB_closeWindowButton .screen-reader-text {
    display: none;
}

/* Split View Layout */
.wpkunaki-split-view {
    display: flex;
    flex-direction: column;
    margin: 20px 0;
    gap: 20px;
}

.wpkunaki-list-container {
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 1;
}

.wpkunaki-map-container {
    width: 100%;
    height: 400px;
}

/* Main Table Styles */
.wpkunaki-frontend {
    width: 100%;
    border: none;
    border-collapse: separate;
    border-spacing: 0 16px;
    background: transparent;
    position: relative;
    display: table !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.wpkunaki-frontend thead {
    display: none;
}

.wpkunaki-frontend tr {
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: table-row !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wpkunaki-frontend tr.wpkunaki-filtered-hidden {
    display: none !important;
}

.wpkunaki-frontend tr:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.wpkunaki-frontend td {
    padding: 24px;
    border: none;
    vertical-align: top;
    background: white;
    color: #444;
}

.wpkunaki-frontend td:first-child {
    width: 160px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.wpkunaki-frontend td:nth-child(2) {
    padding-right: 48px;
}

.wpkunaki-frontend td:last-child {
    width: 200px;
    text-align: right;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Profile Image Styles */
.wpkunaki-profile-image {
    width: 160px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 12px;
}

.wpkunaki-badge {
	display:inline;
}

.wpkunaki-badge-image, .wpkunaki-badge img {
    max-width: 90px;
	max-height: 90px;
    border-radius: 4px;
    margin: 8px 0;
    display: inline-block;
}

/* Name and Title Styles */
.wpkunaki-name {
    color: #2557a7;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.wpkunaki-name:hover {
    text-decoration: underline;
}

.wpkunaki-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

/* Address Styles */
.wpkunaki-address {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

/* Contact Information Styles */
.wpkunaki-frontend td:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
}

.wpkunaki-phone {
    text-align: center;
    width: 100%;
    margin: 8px 0 12px;
}

.phone-link {
    color: #333;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.phone-link:hover {
    color: #2557a7;
    text-decoration: none;
}

.wpkunaki-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Button Styles */
.wpkunaki-button {
    display: block;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    max-width: 100%;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.wpkunaki-button:hover {
    z-index: 10;
}

.wpkunaki-truncate {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wpkunaki-button:hover .wpkunaki-truncate {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.wpkunaki-button-email, .wpkunaki-button-website {
    background: white;
    border: 1px solid #2557a7;
    color: #2557a7;
}

.wpkunaki-button-view {
    background: #2557a7;
    border: 1px solid #2557a7;
    color: white;
}

/* Location Search Styles */
.wpkunaki-location-container {
    margin: 1em 0;
    text-align: center;
}

.wpkunaki-current-location {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wpkunaki-current-location p {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
}

.wpkunaki-location-link {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.wpkunaki-search-location, .wpkunaki-location-button {
    background: #2557a7;
    color: white !important;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
    min-width: 200px;
    text-align: center;
}

.wpkunaki-search-location:hover, .wpkunaki-location-button:hover {
    background: #1d4585;
    color: white !important;
    text-decoration: none;
}

/* Center align dropdowns and buttons */
.wpkunaki-dropdown-container {
    text-align: center;
    margin: 0;
}

.wpkunaki-button-container {
    text-align: center;
    margin: 20px 0;
}

/* Bio Truncation Styles */
.wpkunaki-bio {
    margin-top: 8px;
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
    position: relative;
    transition: max-height 0.3s ease;
    text-align: left;
}

.wpkunaki-bio-truncated {
    max-height: 5.6em; /* Approximately 4 lines at 1.4 line-height */
    overflow: hidden;
    cursor: pointer;
}

.wpkunaki-bio-truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 80%);
    pointer-events: none;
}

.wpkunaki-bio-truncated:hover::after {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wpkunaki-bio-expanded {
    max-height: none !important;
    cursor: default !important;
}

.wpkunaki-bio-expanded::after {
    display: none;
}

.wpkunaki-joined {
    color: #999;
    font-size: 0.85em;
    margin-bottom: 8px;
}

/* Directory Filters */
.wpkunaki-filters-container {
    text-align: center;
    margin: 20px 0 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.wpkunaki-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.wpkunaki-badge-filters {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.wpkunaki-filter-btn {
    padding: 10px 24px;
    border: 2px solid #2557a7;
    background: white;
    color: #2557a7;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    white-space: nowrap;
}

.wpkunaki-filter-btn:hover {
    background: #f0f5fb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 87, 167, 0.2);
}

.wpkunaki-filter-btn.active {
    background: #2557a7;
    color: white;
    box-shadow: 0 2px 6px rgba(37, 87, 167, 0.3);
}

.wpkunaki-filter-btn.active:hover {
    background: #1d4585;
}

.wpkunaki-badge-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
}

.wpkunaki-badge-filter-btn img {
    height: 20px;
    width: auto;
    vertical-align: middle;
    margin-right: 5px;
}

.wpkunaki-filter-clear {
    padding: 10px 24px;
    border: 2px solid #666;
    background: white;
    color: #666;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    white-space: nowrap;
    margin-left: 10px;
}

.wpkunaki-filter-clear:hover {
    background: #f5f5f5;
    border-color: #444;
    color: #444;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Loading Spinner Styles */
#wpkunaki_load {
    text-align: center;
    margin: 40px auto;
    display: block;
    max-width: 32px;
}

#wpkunaki_search_country,
#wpkunaki_search_state {
    display: inline-block !important;
    vertical-align: middle;
    margin: 0;
}

#wpkunaki_country, #wpkunaki_state {
    display: inline-block !important;
    margin: 0 5px;
    min-width: 200px;
    vertical-align: middle;
    height: 48px;
    padding: 12px 14px;
    box-sizing: border-box;
    line-height: 1.3;
}

/* Nudge state dropdown up slightly to match country */
#wpkunaki_state {
    position: relative;
    top: -1px;
}

.wpkunaki-clear-location {
    color: #dc3545 !important;
    border: 1px solid #dc3545;
}

.wpkunaki-clear-location:hover {
    background: #dc3545;
    color: white !important;
    text-decoration: none;
}

/* Map Styles */
#map-canvas {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
}

.wpkunaki-marker {
    background: transparent;
    border: none;
}

.marker-number {
    background: #0073aa;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
}

/* Scrollbar Styles */
.wpkunaki-list-container::-webkit-scrollbar {
    width: 8px;
}

.wpkunaki-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wpkunaki-list-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.wpkunaki-list-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* State Styles */
.wpkunaki-result-row.highlighted {
    background-color: #e6f3f8;
    transition: background-color 0.3s ease;
}

/* Responsive Layout */
@media (max-width: 1024px) {
    .wpkunaki-split-view {
        flex-direction: column;
    }
    
    .wpkunaki-map-container {
        position: relative;
        height: 400px;
        width: 100%;
        max-width: 100%;
        top: 0;
    }
    
    .wpkunaki-list-container {
        width: 100%;
    }
}

/* Mobile Responsive Styles - Psychology Today Style */
@media (max-width: 900px) {
    /* Convert table to block layout on mobile */
    .wpkunaki-frontend {
        border-spacing: 0 12px;
    }
    
    .wpkunaki-frontend tr {
        display: block !important;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .wpkunaki-frontend td {
        display: block !important;
        width: 100% !important;
        padding: 16px !important;
        text-align: left !important;
        border-radius: 0 !important;
    }
    
    .wpkunaki-frontend td:first-child {
        padding-bottom: 12px !important;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 8px 8px 0 0 !important;
    }
    
    .wpkunaki-frontend td:nth-child(2) {
        padding: 16px !important;
    }
    
    .wpkunaki-frontend td:last-child {
        display: flex !important;
        flex-direction: column;
        align-items: center !important;
        padding-top: 12px !important;
        border-top: 1px solid #f0f0f0;
        border-radius: 0 0 8px 8px !important;
    }
    
    /* Profile image - smaller and contained on mobile */
    .wpkunaki-profile-image {
        width: 120px;
        height: 150px;
        margin: 0 auto 12px;
    }
    
    /* Name and title */
    .wpkunaki-name {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .wpkunaki-title {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .wpkunaki-joined {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    
    /* Address styles */
    .wpkunaki-address {
        font-size: 13px;
        line-height: 1.4;
    }
    
    /* Bio text */
    .wpkunaki-bio {
        font-size: 0.85em;
        line-height: 1.5;
        margin-top: 12px;
    }
    
    .wpkunaki-bio-truncated {
        max-height: 6.0em;
    }
    
    /* Phone number */
    .wpkunaki-phone {
        text-align: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 12px;
    }
    
    .phone-link {
        font-size: 18px;
    }
    
    /* Buttons - constrained width on mobile */
    .wpkunaki-buttons {
        width: 100%;
        max-width: 300px;
        gap: 10px;
    }
    
    .wpkunaki-button {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        text-align: center;
    }
    
    /* Badge images */
    .wpkunaki-badge-image, .wpkunaki-badge img {
        max-width: 70px;
        max-height: 70px;
        margin: 6px 0;
    }
    
    /* Filter buttons - stack better on mobile */
    .wpkunaki-filters-container {
        padding: 15px;
        margin: 15px 0 20px;
    }
    
    .wpkunaki-filter-buttons {
        gap: 8px;
    }
    
    .wpkunaki-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .wpkunaki-filter-clear {
        padding: 8px 16px;
        font-size: 13px;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .wpkunaki-frontend {
        border-spacing: 0 10px;
    }
    
    .wpkunaki-frontend tr {
        margin-bottom: 12px;
    }
    
    .wpkunaki-frontend td {
        padding: 12px !important;
    }
    
    .wpkunaki-frontend td:first-child {
        padding-bottom: 10px !important;
    }
    
    .wpkunaki-frontend td:last-child {
        padding-top: 10px !important;
    }
    
    .wpkunaki-profile-image {
        width: 100px;
        height: 125px;
    }
    
    .wpkunaki-name {
        font-size: 16px;
    }
    
    .wpkunaki-title {
        font-size: 12px;
    }
    
    .wpkunaki-bio {
        font-size: 0.8em;
    }
    
    .phone-link {
        font-size: 16px;
    }
    
    .wpkunaki-phone {
        max-width: 280px;
    }
    
    .wpkunaki-buttons {
        max-width: 280px;
    }
    
    .wpkunaki-button {
        padding: 11px 14px;
        font-size: 13px;
    }
    
    .wpkunaki-filters-container {
        padding: 12px;
    }
    
    .wpkunaki-filter-btn,
    .wpkunaki-filter-clear {
        padding: 7px 14px;
        font-size: 12px;
    }
}

/* Search Section - Landing Page and Search Results Styling */
.wpkunaki-search-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    text-align: center;
}

.wpkunaki-search-section h2 {
    color: #2557a7;
    margin-bottom: 20px;
}

.wpkunaki-landing-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wpkunaki-landing-search-form p {
    margin-bottom: 15px;
}

.wpkunaki-landing-search-form label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.wpkunaki-landing-search-form input[type="search"],
.wpkunaki-landing-search-form input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.wpkunaki-landing-search-form input[type="search"]:focus,
.wpkunaki-landing-search-form input[type="number"]:focus {
    outline: none;
    border-color: #2557a7;
    box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.1);
}/* Address confirmation. Own box, so the theme's 9px body text, 24px
   inputs, and 32px headings do not resize it. Font family is inherited
   so it still sits with the theme. #wpkunaki_table's 300px cap is for
   the admin list; it must not scroll this form. */
.wpkunaki-dialog {
    width: min(36rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    border: 1px solid #c5c5c5;
    background: #fff;
    color: #222;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
}

.wpkunaki-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.wpkunaki-dialog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
    background: #f6f6f6;
    text-align: left;
}

.wpkunaki-dialog-bar h2 {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #222;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: normal;
    text-align: left;
}

.wpkunaki-dialog-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid #888;
    border-radius: 0.15rem;
    background: #fff;
    color: #222;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.wpkunaki-dialog-body {
    box-sizing: border-box;
    max-height: calc(100vh - 6.5rem);
    max-height: calc(100dvh - 6.5rem);
    overflow: auto;
    padding: 0.9rem 1rem 1rem;
}

.wpkunaki-dialog #wpkunaki_table {
    max-height: none;
    overflow: visible;
}

.wpkunaki-dialog p,
.wpkunaki-dialog label,
.wpkunaki-dialog small {
    color: #222;
    font-size: 0.95rem;
    line-height: 1.4;
}

.wpkunaki-dialog .wpkunaki_popup_details {
    margin: 0.15rem 0 1.35rem;
}

.wpkunaki-dialog .wpkunaki_clear {
    margin: 0 0 0.7rem;
}

.wpkunaki-dialog .wpkunaki_clear_city {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem 1.5rem;
}

.wpkunaki-dialog .wpkunaki_place {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wpkunaki-dialog .wpkunaki-hidden {
    display: none !important;
}

.wpkunaki-dialog .wpkunaki_label {
    display: block;
    margin: 0 0 0.15rem;
}

.wpkunaki-dialog input[type="text"],
.wpkunaki-dialog select {
    box-sizing: border-box;
    height: 2.4rem;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid #888;
    background: #fff;
    background-image: none;
    color: #222;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.3;
}

.wpkunaki-dialog input[type="text"] {
    width: 22rem;
}

.wpkunaki-dialog .wpkunaki_field_city input,
.wpkunaki-dialog .wpkunaki_field_zip input {
    width: 10rem;
}

.wpkunaki-dialog select {
    display: inline-block !important;
    width: auto;
    min-width: 6rem;
    vertical-align: middle;
}

@media (max-width: 520px) {
    .wpkunaki-dialog .wpkunaki_clear_city {
        flex-direction: column;
        align-items: stretch;
    }

    .wpkunaki-dialog .wpkunaki_place {
        width: 100%;
    }

    .wpkunaki-dialog input[type="text"],
    .wpkunaki-dialog .wpkunaki_field_city input,
    .wpkunaki-dialog .wpkunaki_field_zip input {
        width: 100%;
    }
}

.wpkunaki-dialog .wpkunaki-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.wpkunaki-dialog .wpkunaki-actions input {
    margin: 0;
    padding: 0.45rem 0.85rem;
    border: 1px solid #666;
    background: #f3f3f3;
    color: #222;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
}

.wpkunaki-dialog :focus-visible {
    outline: 3px solid #0b3a82;
    outline-offset: 2px;
}