/* ============================================================
   CoPet City Split-View Layout
   Used on /lang/Country/map/pet/{city} pages
   ============================================================ */

/* ── Top bar (language dropdown sits outside split wrapper) ── */
.split-top-bar {
    max-width: 100%;
    padding: 8px 20px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ── Main split container ── */
.split-wrapper {
    display: flex;
    height: calc(100vh - 64px);   /* subtract navbar height */
    overflow: hidden;
    max-width: 100%;
}

/* ── Left panel: scrollable cards ── */
.cards-panel {
    width: 40%;
    overflow-y: auto;
    padding: 16px 20px;
    background: #fff;
    border-right: 1px solid #e8e0d5;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

/* ── Right panel: sticky map ── */
.map-panel {
    width: 60%;
    position: relative;
    flex-shrink: 0;
}

.map-panel #map {
    height: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── City heading inside cards panel ── */
.city-h1 {
    font-size: 1.3em;
    font-weight: 700;
    color: #006400;
    margin: 8px 0 4px;
    line-height: 1.3;
}

.city-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Pet count badge ── */
.city-count-badge {
    display: inline-block;
    background: linear-gradient(135deg, #007D06, #006400);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

/* ── Category filter links ── */
.category-links {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #faf6f0;
    border-radius: 12px;
    border: 1px solid #e8ddd0;
}

.category-links-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}

.category-link {
    display: inline-block;
    background: white;
    border: 1px solid #007D06;
    color: #006400;
    padding: 3px 9px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin: 3px 3px 3px 0;
    transition: background 0.15s, color 0.15s;
}

.category-link:hover {
    background: #007D06;
    color: white;
    text-decoration: none;
}

.category-link.active {
    background: #006400;
    color: white;
    border-color: #006400;
    text-decoration: none;
}

/* ── Pet cards ── */
.pet-card {
    display: flex;
    gap: 12px;
    border-radius: 20px;
    border: 2px solid #e8e0d5;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    background: white;
}

.pet-card:hover {
    border-color: #007D06;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,125,6,0.2);
}

.pet-card.active {
    border: 2px solid red;
    background: rgba(0, 125, 6, 0.06);
    box-shadow: 0 2px 8px rgba(0,125,6,0.25);
}

.pet-card-img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.pet-card-img-placeholder {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    background: linear-gradient(135deg, #007D06, #006400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 26px;
}

.pet-card-body {
    flex: 1;
    min-width: 0;
}

.pet-card-name {
    font-weight: 700;
    font-size: 13px;
    color: #006400;
    margin-bottom: 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-card-type {
    display: inline-block;
    background: rgba(0, 125, 6, 0.15);
    color: #006400;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.pet-card-address {
    font-size: 11px;
    color: #888;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.pet-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pet-card-link {
    display: inline-block;
    background: #1a1a1a;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.pet-card-link:hover {
    background: #006400;
    color: white;
    text-decoration: none;
}

/* ── "Load more" trigger ── */
.load-more-cards {
    display: block;
    width: 100%;
    padding: 10px;
    background: #faf6f0;
    border: 1px dashed #007D06;
    border-radius: 12px;
    color: #006400;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.load-more-cards:hover {
    background: rgba(0,125,6,0.1);
}

/* ── Filter row inside cards panel ── */
.cards-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cards-filter-row .search-container {
    max-width: 100%;
    width: 100%;
    margin-bottom: 0;
}

.cards-filter-row .type-filter-dropdown {
    flex-shrink: 0;
}

/* ── View-on-map overlay button (mobile only) ── */
.view-on-map-btn {
    display: none;
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    background: rgba(20, 20, 20, 0.88);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    z-index: 500;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    transition: background 0.2s;
}
.view-on-map-btn:hover {
    background: rgba(0,0,0,1);
}

/* ── Mobile: map thumbnail first, then listing ── */
@media (max-width: 768px) {
    .split-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    /* Map thumbnail at TOP */
    .map-panel {
        order: -1;
        width: 100%;
        height: 200px;
        position: relative;
        overflow: hidden;
        flex-shrink: 0;
    }

    .map-panel.map-expanded {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 9999;
        overflow: visible;
    }

    .map-panel #map {
        height: 200px !important;
        border-radius: 0 !important;
        pointer-events: none;
        filter: blur(4px);
        opacity: 0.5;
        transition: filter 0.3s, opacity 0.3s;
    }

    .map-panel.map-expanded #map {
        height: 100% !important;
        pointer-events: all;
        filter: none !important;
        opacity: 1 !important;
    }

    /* Close button repositioned inside fullscreen map */
    .map-panel.map-expanded .view-on-map-btn {
        display: flex !important;
        bottom: 16px;
        top: auto;
        left: 16px;
        transform: none;
    }

    /* Cards listing below */
    .cards-panel {
        width: 100%;
        border-right: none;
        border-top: 1px solid #e8e0d5;
        max-height: none;
        overflow-y: visible;
    }

    .view-on-map-btn {
        display: flex;
    }
}

/* ── Country navigation section (replaces old flag section) ── */
.country-nav-section {
    background: #faf6f0;
    border-top: 1px solid #e8ddd0;
    padding: 28px 0 20px;
}

.cnav-card {
    background: white;
    border: 2px solid #e8e0d5;
    border-radius: 18px;
    padding: 16px 12px 14px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cnav-card.active {
    border-color: #007D06;
    box-shadow: 0 2px 12px rgba(0,125,6,0.2);
}

.cnav-card:hover {
    border-color: #007D06;
}

.cnav-flag {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.cnav-name {
    font-size: 13px;
    font-weight: 700;
    color: #006400;
    margin-bottom: 10px;
}

.cnav-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.cnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.cnav-btn.pets {
    background: #f0ebe4;
    color: #006400;
    border: 1px solid #007D06;
}

.cnav-btn.pets:hover {
    background: #007D06;
    color: white;
    text-decoration: none;
}

.cnav-btn.saints {
    background: #006400;
    color: white;
    border: 1px solid #006400;
}

.cnav-btn.saints:hover {
    background: #6b3f1e;
    color: white;
    text-decoration: none;
}

/* ── Filter + Search UI (ported from PR-s.css / PREV.css) ── */
.filter-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.type-filter-dropdown {
    position: relative;
    min-width: 200px;
}

.type-filter-button {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.type-filter-button:hover,
.type-filter-button.active {
    border-color: #007D06;
}

.type-filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #007D06;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.type-filter-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.type-filter-item:hover {
    background-color: #f0faf0;
}

.type-filter-item:last-child {
    border-bottom: none;
}

.type-count {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

.clear-filters {
    background: #007D06;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.clear-filters:hover {
    background: #006400;
}

.search-container {
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    max-width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #007D06;
}

.search-button {
    padding: 10px 18px;
    background: linear-gradient(135deg, #007D06, #006400);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.3s;
}

.search-button:hover {
    background: linear-gradient(135deg, #006400, #007D06);
}

.error-message {
    color: #ff0000;
    margin-top: 5px;
    display: none;
}

/* ── Loader ── */
body.loading { overflow: hidden !important; }

.codoctor-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(135deg, #007D06 0%, #006400 50%, #007D06 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.codoctor-loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo {
    width: 100px; height: auto;
    margin-bottom: 30px;
    animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) scale(1); filter: drop-shadow(0 10px 30px rgba(0,0,0,0.2)); }
    50%       { transform: translateY(-15px) scale(1.05); filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3)); }
}

.loader-progress {
    width: 300px; height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px; overflow: hidden;
    margin-bottom: 20px; position: relative;
}
.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0.8) 100%);
    border-radius: 10px; width: 0%;
    transition: width 0.3s ease;
    position: relative; overflow: hidden;
}
.loader-progress-bar::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }

.loader-text {
    color: white; font-size: 16px; font-weight: 500;
    margin-bottom: 10px; opacity: 0.9;
    animation: textPulse 2s ease-in-out infinite;
}
@keyframes textPulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.7; } }

.loader-subtitle {
    color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 300;
    text-align: center; max-width: 300px; line-height: 1.4;
}

.loader-particles { position: absolute; width: 100%; height: 100%; overflow: hidden; }
.particle {
    position: absolute;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: particleFloat 20s linear infinite;
}
.particle:nth-child(1) { width:4px; height:4px; left:10%; animation-delay:0s; }
.particle:nth-child(2) { width:6px; height:6px; left:20%; animation-delay:2s; }
.particle:nth-child(3) { width:3px; height:3px; left:30%; animation-delay:4s; }
.particle:nth-child(4) { width:5px; height:5px; left:40%; animation-delay:6s; }
.particle:nth-child(5) { width:4px; height:4px; left:50%; animation-delay:8s; }
.particle:nth-child(6) { width:7px; height:7px; left:60%; animation-delay:10s; }
.particle:nth-child(7) { width:3px; height:3px; left:70%; animation-delay:12s; }
.particle:nth-child(8) { width:5px; height:5px; left:80%; animation-delay:14s; }
.particle:nth-child(9) { width:4px; height:4px; left:90%; animation-delay:16s; }
@keyframes particleFloat {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

@media (max-width: 768px) {
    .loader-logo { width: 100px; margin-bottom: 25px; }
    .loader-progress { width: 250px; }
    .loader-text { font-size: 14px; }
    .loader-subtitle { font-size: 12px; max-width: 250px; }
}
