/* Search Page Specific Styles - Modern Redesign */

/* ================================
   CSS CUSTOM PROPERTIES
   ================================ */
:root {
    --sp-primary: #6366f1;
    --sp-primary-dark: #4f46e5;
    --sp-primary-darker: #4338ca;
    --sp-gray-50: #f8fafc;
    --sp-gray-100: #f1f5f9;
    --sp-gray-200: #e2e8f0;
    --sp-gray-300: #cbd5e1;
    --sp-gray-400: #94a3b8;
    --sp-gray-500: #64748b;
    --sp-gray-600: #475569;
    --sp-gray-700: #334155;
    --sp-gray-800: #1e293b;
    --sp-gray-900: #0f172a;
    --sp-radius-sm: 10px;
    --sp-radius-md: 12px;
    --sp-radius-lg: 16px;
    --sp-radius-full: 50px;
    --sp-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --sp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sp-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --sp-transition: all 0.2s ease;
    --sp-gradient-primary: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-dark) 100%);
}

/* ================================
   SEARCH BAR CONTAINER
   ================================ */
.search-bar-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Freshness Guarantee Card */
.freshness-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--sp-radius-lg);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

.freshness-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.freshness-card-icon svg {
    color: white;
}

.freshness-card-content {
    flex: 1;
}

.freshness-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 4px;
}

.freshness-card-text {
    font-size: 14px;
    color: #15803d;
    line-height: 1.5;
}

@media (max-width: 576px) {
    .freshness-card {
        padding: 16px;
        gap: 12px;
    }

    .freshness-card-icon {
        width: 40px;
        height: 40px;
    }

    .freshness-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .freshness-card-title {
        font-size: 14px;
    }

    .freshness-card-text {
        font-size: 13px;
    }
}

/* ================================
   FILTER SECTIONS
   ================================ */
.filter-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.filter-label svg {
    opacity: 0.7;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 16px 0;
}

/* ================================
   FILTER PILL BUTTONS
   ================================ */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

.filter-pill:active {
    transform: scale(0.98);
}

.filter-pill.active {
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-pill img {
    border-radius: 2px;
}

/* Country-specific active states */
.filter-pill.all-filter.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.filter-pill.myanmar-pill.active {
    background: linear-gradient(135deg, #d4a853 0%, #c49a47 100%);
}

.filter-pill.india-pill.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.filter-pill.philippines-pill.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.filter-pill.indonesia-pill.active {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

/* Special filter pills */
.filter-pill.special-pill {
    border-style: dashed;
}

.filter-pill.recently-listed-pill.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-style: solid;
}

.filter-pill.recommended-pill.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-style: solid;
}

/* ================================
   ADVANCED FILTER BUTTON
   ================================ */
.filter-actions {
    justify-content: space-between;
}

.btn-advanced-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-advanced-filter:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-advanced-filter:active {
    transform: scale(0.98);
}

/* ================================
   ACTIVE FILTERS DISPLAY
   ================================ */
.active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.active-filters-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #e0e7ff;
    color: #4338ca;
    animation: fadeIn 0.2s ease;
}

.active-filter-tag .remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(67, 56, 202, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.active-filter-tag .remove-filter:hover {
    background: rgba(67, 56, 202, 0.4);
}

.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* ================================
   RESULTS SUMMARY
   ================================ */
.results-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.results-count {
    font-size: 14px;
    color: #64748b;
}

.results-count strong {
    color: #1e293b;
    font-weight: 600;
}

/* ================================
   FILTER MODAL STYLES
   ================================ */
.filter-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.filter-modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-bottom: none;
    padding: 20px 24px;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-icon {
    opacity: 0.9;
}

.filter-modal-header .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.filter-modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.filter-modal-header .btn-close:hover {
    opacity: 1;
}

.filter-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Filter groups */
.filter-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-group-header svg {
    color: #6366f1;
}

/* Form controls */
.filter-modal-body .form-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.filter-modal-body .form-select,
.filter-modal-body .form-control {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-modal-body .form-select:focus,
.filter-modal-body .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modal footer */
.filter-modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    gap: 12px;
}

.filter-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-modal-footer .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
}

.filter-modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.filter-modal-footer .btn-outline-secondary {
    border-color: #e2e8f0;
    color: #64748b;
}

.filter-modal-footer .btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

/* Fix double dropdown arrows */
#filterModal .form-select,
.modal .form-select,
select.form-select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
}

/* Nationality checkboxes styling - Modern Card Design */
.nationality-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 0;
}

.nationality-checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
}

.nationality-checkbox-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nationality-checkbox-item .form-check-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.nationality-checkbox-item .checkbox-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    transition: color 0.2s ease;
}

.nationality-checkbox-item .checkbox-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nationality-checkbox-item .checkbox-checkmark svg {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    color: white;
}

/* Checked state */
.nationality-checkbox-item .form-check-input:checked ~ .checkbox-checkmark {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #4f46e5;
}

.nationality-checkbox-item .form-check-input:checked ~ .checkbox-checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.nationality-checkbox-item .form-check-input:checked ~ .checkbox-label {
    color: #1e293b;
    font-weight: 600;
}

.nationality-checkbox-item:has(.form-check-input:checked) {
    border-color: #6366f1;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Focus state for accessibility */
.nationality-checkbox-item .form-check-input:focus ~ .checkbox-checkmark {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nationality-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .nationality-checkbox-item {
        padding: 12px 14px;
    }

    .nationality-checkbox-item .checkbox-label {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .nationality-checkboxes {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* ================================
   WELCOME ALERT
   ================================ */
.welcome-alert {
    background: linear-gradient(135deg, #e0e7ff 0%, #f0e6ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    color: #1e293b;
}

.welcome-alert h4 {
    color: #1e293b;
    font-weight: 700;
}

.welcome-alert p {
    font-size: 16px;
    color: #475569;
    font-weight: 500;
}

.welcome-alert .btn-primary {
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 10px;
}

.welcome-alert .btn-outline-primary {
    font-weight: 600;
    color: #4f46e5;
    border-color: #4f46e5;
    border-radius: 10px;
}

.welcome-alert .btn-outline-primary:hover {
    background: #4f46e5;
    color: white;
}

/* ================================
   BLURRED PROFILE STYLES
   ================================ */
.inner-image-img.profile-image-blurred {
    filter: blur(10px);
    -webkit-filter: blur(10px);
    transition: filter 0.3s ease;
    cursor: pointer;
    width: 260px !important;
    height: auto;
    max-height: 340px;
    pointer-events: auto;
    z-index: 8;
}

.profile-block:hover .inner-image-img.profile-image-blurred {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    cursor: pointer;
}

.profile-block {
    position: relative !important;
}

.profile-overlay {
    position: absolute;
    top: 135px;
    left: 130px;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.profile-overlay:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.profile-overlay .lock-icon {
    font-size: 16px;
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ================================
   LOADING STATE
   ================================ */
.search-bar-container.loading {
    pointer-events: none;
    opacity: 0.7;
}

.search-bar-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
}

/* ================================
   RESPONSIVE STYLES
   ================================ */
@media (max-width: 768px) {
    .search-bar-container {
        padding: 16px;
        border-radius: 12px;
    }

    .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-label {
        min-width: auto;
    }

    .filter-pills {
        width: 100%;
    }

    .filter-pill {
        padding: 8px 14px;
        font-size: 13px;
    }

    .filter-pill img {
        width: 16px;
        height: 16px;
    }

    .filter-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-advanced-filter {
        width: 100%;
        justify-content: center;
    }

    .active-filters {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-modal-body {
        padding: 16px;
    }

    .filter-group {
        padding: 16px;
    }

    .results-summary {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .filter-pill {
        flex: 1;
        min-width: calc(50% - 4px);
        justify-content: center;
    }

    .filter-pill.all-filter {
        flex: none;
        min-width: auto;
    }
}


/* ================================
   PAGINATION
   ================================ */
.pagination {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: white;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.pagination .page-item .page-link:hover {
    border-color: #6366f1;
    color: #4f46e5;
    background: #f5f3ff;
    transform: translateY(-1px);
}

.pagination .page-item .page-link:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pagination .page-item.active .page-link:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
}

.pagination .page-item.disabled .page-link {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.pagination .page-item.disabled .page-link:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #cbd5e1;
    transform: none;
}

/* Ellipsis styling */
.pagination .page-item.disabled .page-link:not([href]) {
    background: transparent;
    border-color: transparent;
}

/* Arrow buttons */
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    font-size: 16px;
    font-weight: 600;
}

/* Responsive pagination */
@media (max-width: 576px) {
    .pagination {
        gap: 4px;
    }

    .pagination .page-item .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* ================================
   ICON EXPLANATION COMPONENT
   ================================ */
.icon-explanation-wrapper {
    margin-top: 24px;
    margin-bottom: 24px;
}

.btn-icon-guide {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-guide:hover {
    border-color: #6366f1;
    color: #4f46e5;
    background: #f5f3ff;
}

.btn-icon-guide:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-icon-guide.active,
.btn-icon-guide[aria-expanded="true"] {
    border-color: #6366f1;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.btn-icon-guide svg {
    transition: transform 0.2s ease;
}

.btn-icon-guide[aria-expanded="true"] svg.chevron-icon {
    transform: rotate(180deg);
}

/* Icon Guide Card */
.icon-guide-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-top: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.icon-guide-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-guide-header svg {
    color: #6366f1;
}

.icon-guide-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.icon-guide-body {
    padding: 20px;
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.icon-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.icon-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.icon-item-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 40px;
}

.icon-item-icons img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.icon-item-text {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: 1fr;
    }

    .icon-guide-body {
        padding: 16px;
    }

    .icon-item {
        padding: 8px 12px;
    }

    .icon-item-icons img {
        width: 24px;
        height: 24px;
    }

    .icon-item-text {
        font-size: 12px;
    }
}

/* ================================
   MDW PROFILE CARD
   ================================ */
.mdw-card {
    background: white;
    border-radius: var(--sp-radius-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--sp-gray-200);
    overflow: hidden;
    margin-bottom: 16px;
    transition: var(--sp-transition);
}

.mdw-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: var(--sp-primary);
}

.mdw-card-photo {
    position: relative;
    isolation: isolate; /* Creates new stacking context for z-index */
    background: white;
}

/* Preserve original profile-block layout */
.mdw-card .profile-block {
    margin: 0;
    position: relative;
    height: 330px;
    text-align: right;
}

/* Fix z-index stacking while preserving absolute positioning */
.mdw-card .profile-block .inner-image-back {
    z-index: 1 !important;
    position: absolute;
}

.mdw-card .profile-block .inner-image-img {
    z-index: 2 !important;
    position: absolute; /* Keep absolute positioning for right alignment */
}

.mdw-card .profile-block .inner-image-flag,
.mdw-card .profile-block .inner-image-edu,
.mdw-card .profile-block .inner-image-religion,
.mdw-card .profile-block .inner-image-exp,
.mdw-card .profile-block .inner-image-guaranteed {
    z-index: 3 !important;
}

.mdw-card .profile-block .profile-age {
    z-index: 10 !important;
    position: relative;
    padding-right: 12px; /* Add spacing from right border */
}

/* Move guaranteed icon left to avoid right border */
.mdw-card .profile-block .inner-image-guaranteed {
    left: 72% !important; /* Move from 80% to 72% */
}

/* Reduce spacing between cards in grid */
#search-results.row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0;
}

#search-results > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.mdw-card-body {
    padding: 16px 20px;
}

.mdw-card-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sp-gray-100);
    margin-bottom: 12px;
}

.mdw-card-icons > div {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.mdw-card-icons img {
    width: 36px;
    height: 36px;
}

.mdw-card-languages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--sp-gray-100);
}

.mdw-card-name {
    text-align: center;
    padding: 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--sp-gray-800);
}

.mdw-card-name a {
    color: var(--sp-gray-800);
    text-decoration: none;
}

.mdw-card-name a:hover {
    color: var(--sp-primary);
}

.mdw-card-name img {
    vertical-align: middle;
    margin-left: 4px;
}

.mdw-card-supplier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--sp-gray-50);
    border-radius: 8px;
    margin-bottom: 12px;
}

.supplier-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--sp-gray-600);
}

.supplier-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    transition: var(--sp-transition);
}

.supplier-action-btn:hover {
    background: var(--sp-gray-100);
}

.mdw-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--sp-gray-100);
}

.mdw-card-update {
    font-size: 13px;
    color: var(--sp-gray-500);
}

.mdw-card-actions {
    display: flex;
    gap: 8px;
}

.mdw-card-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Responsive card adjustments */
@media (max-width: 576px) {
    .mdw-card {
        margin-bottom: 12px;
    }

    .mdw-card-body {
        padding: 12px;
    }

    .mdw-card-name {
        font-size: 16px;
    }

    .mdw-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .mdw-card-actions {
        justify-content: center;
    }

    #search-results.row {
        --bs-gutter-x: 0.5rem;
    }

    #search-results > [class*="col-"] {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}
