/* ========================================
   Expert Profile Directory - Modern Teal Design
   ======================================== */

:root {
    --epd-primary: #016450;
    --epd-secondary: #008996;
    --epd-primary-dark: #013d30;
    --epd-secondary-light: #00a8b8;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   MAIN WRAPPER
   ======================================== */

.epd-search-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
   
}

/* ========================================
   TOP BAR WITH FILTER BUTTON
   ======================================== */

.epd-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.epd-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--epd-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 137, 150, 0.3);
    position: relative;
}

.epd-filter-button:hover {
    background: var(--epd-secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 137, 150, 0.4);
}

.epd-filter-button:active {
    transform: translateY(0);
}

.epd-filter-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.epd-filter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

.epd-results-info {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

#epd-total-results {
    font-size: 24px;
    font-weight: 700;
    color: var(--epd-primary);
}

/* ========================================
   ACTIVE FILTERS DISPLAY
   ======================================== */

.epd-active-filters {
    background: white;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.epd-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #e8f5f3;
    border: 2px solid var(--epd-secondary);
    border-radius: 20px;
    font-size: 14px;
    color: var(--epd-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.epd-filter-tag:hover {
    background: var(--epd-secondary);
    color: white;
    border-color: var(--epd-primary);
}

.epd-filter-tag-remove {
    cursor: pointer;
    color: var(--epd-secondary);
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s;
}

.epd-filter-tag:hover .epd-filter-tag-remove {
    color: white;
}

/* ========================================
   FILTER MODAL POPUP
   ======================================== */

.epd-filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.epd-filter-modal.active {
    display: block;
}

.epd-filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.epd-filter-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.epd-filter-header {
    background: linear-gradient(135deg, var(--epd-primary) 0%, var(--epd-secondary) 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.epd-filter-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white !important;
}

.epd-filter-header .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
    color: white;
}

.epd-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epd-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.epd-modal-close .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.epd-filter-form {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.epd-filter-form::-webkit-scrollbar {
    width: 8px;
}

.epd-filter-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.epd-filter-form::-webkit-scrollbar-thumb {
    background: var(--epd-secondary);
    border-radius: 4px;
}

.epd-filter-form::-webkit-scrollbar-thumb:hover {
    background: var(--epd-primary);
}

.epd-filter-group {
    margin-bottom: 24px;
}

.epd-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--epd-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.epd-filter-group label .dashicons {
    color: var(--epd-secondary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.epd-filter-group input[type="text"],
.epd-filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.epd-filter-group input[type="text"]:focus,
.epd-filter-group select:focus {
    outline: none;
    border-color: var(--epd-secondary);
    box-shadow: 0 0 0 4px rgba(0, 137, 150, 0.1);
}

.epd-filter-footer {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 2px solid #e5e5e5;
    display: flex;
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

.epd-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.epd-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.epd-btn-secondary {
    background: #6c757d;
    color: white;
}

.epd-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.epd-btn-primary {
    background: var(--epd-secondary);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 137, 150, 0.3);
}

.epd-btn-primary:hover {
    background: var(--epd-secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 137, 150, 0.4);
}

/* ========================================
   LOADING STATE
   ======================================== */

.epd-loading {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.epd-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--epd-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.epd-loading p {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   RESULTS GRID
   ======================================== */

.epd-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ========================================
   PROFILE CARD - MODERN COLUMN LAYOUT
   ======================================== */

.epd-profile-card {
    display: block;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.epd-profile-card:hover {
    border-color: var(--epd-secondary);
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 137, 150, 0.2);
}


.epd-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    gap: 16px;
}

.epd-card-image {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}



.epd-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}


.epd-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--epd-primary) 0%, var(--epd-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: bold;
}

.epd-card-info {
    width: 100%;
}


.epd-card-name {
    margin: 0 0 8px 0;
    padding: 0;
    font-size: 1.2rem!important;
    font-weight: 700;
    color: var(--epd-primary);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.epd-profile-card:hover .epd-card-name {
    color: var(--epd-secondary);
}


.epd-card-title {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.3s ease;
    font-size:.8rem!important;
}

.epd-profile-card:hover .epd-card-title {
    color: var(--epd-secondary);
}

/* ========================================
   PAGINATION
   ======================================== */

.epd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.epd-page-btn {
    padding: 12px 20px;
    border: 2px solid var(--epd-secondary);
    background: white;
    color: var(--epd-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 14px;
}

.epd-page-btn:hover:not(:disabled) {
    background: var(--epd-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 137, 150, 0.3);
}

.epd-page-btn.active {
    background: var(--epd-primary);
    color: white;
    border-color: var(--epd-primary);
}

.epd-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   NO RESULTS
   ======================================== */

.epd-no-results {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 3px dashed var(--epd-secondary);
}

.epd-no-results p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .epd-results {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .epd-search-wrapper {
        padding: 15px;
    }

    .epd-top-bar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .epd-filter-button {
        width: 100%;
        justify-content: center;
    }

    .epd-results {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .epd-filter-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .epd-card-image {
        width: 120px;
        height: 120px;
    }
    
   
    .epd-card-title {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .epd-filter-footer {
        flex-direction: column;
    }

    .epd-results {
        grid-template-columns: 1fr;
    }

    .epd-card-image {
        width: 100px;
        height: 100px;
    }

    .epd-card-image {
        width: 100px;
        height: 100px;
    }

   

    .epd-card-title {
        font-size: 0.8125rem;
    }

    .epd-card-content {
        padding: 20px;
    }
}

.epd-edu-degrees {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f7f5;
    border-left: 3px solid #016450;
    font-size: 14px;
    color: #555;
}

.epd-edu-degrees strong {
    color: #016450;
    margin-right: 5px;
}

/* Social links repeatable format */
.epd-social-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epd-social-link {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border-left: 3px solid #016450;
}

.epd-social-link:hover {
    background: #016450;
    color: #fff;
}

/* Line break support for textareas */
.epd-section-text {
    white-space: pre-wrap; /* Preserves line breaks */
    word-wrap: break-word;
}

/* ===============================
   RTL Support via HTML lang="ar"
   =============================== */

html[lang="ar"] {
    direction: rtl;
}

/* Text alignment */
html[lang="ar"] .epd-sidebar-section,
html[lang="ar"] .epd-content-section,
html[lang="ar"] .epd-info-label,
html[lang="ar"] .epd-sidebar-list {
    text-align: right;
}

/* Layout direction */
html[lang="ar"] .epd-profile-wrapper {
    direction: rtl;
}

/* Borders flipped for RTL */
html[lang="ar"] .epd-edu-item,
html[lang="ar"] .epd-work-item,
html[lang="ar"] .epd-languages-text {
    border-left: none;
    border-right: 3px solid #016450;
}

/* Lists spacing */
html[lang="ar"] ul,
html[lang="ar"] ol {
    padding-left: 0;
    padding-right: 30px;
}

/* Blockquotes */
html[lang="ar"] blockquote {
    border-left: none;
    border-right: 4px solid #016450;
    padding-left: 0;
    padding-right: 20px;
}


/* ========================================
   Language Switch Loading Overlay (FIXED)
   ======================================== */

.epd-single-profile {
    position: relative;
    /* Removed min-height - let content determine height */
}

.epd-language-loading {
    position: fixed; /* Changed back to fixed to cover viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom:  0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99; /* Higher z-index */
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow:  hidden; /* Prevent scrolling behind overlay */
}

.epd-language-loading.active {
    display: flex;
    opacity: 1;
}

/* Lock body scroll when loading is active */
body.epd-loading-active {
    overflow: hidden;
    height: 100vh;
}

.epd-loading-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #016450 0%, #008996 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    position: relative;
    z-index: 100000;
}

.epd-loading-spinner {
    width:  60px;
    height:  60px;
    margin:  0 auto 20px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid white;
    border-radius: 50%;
    animation:  epd-spin 1s linear infinite;
}

@keyframes epd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.epd-loading-text {
    font-size:  20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.epd-loading-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Dots animation */
.epd-loading-dots {
    display: inline-block;
}

.epd-loading-dots span {
    animation: epd-blink 1.4s infinite;
    animation-fill-mode: both;
}

.epd-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.epd-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes epd-blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

@media (max-width: 768px) {
    .epd-loading-content {
        padding:  30px 20px;
        max-width: 90%;
        margin: 0 20px;
    }
    
    .epd-loading-text {
        font-size: 18px;
    }
    
    .epd-loading-subtext {
        font-size: 13px;
    }
}
  

/* ========================================
   Alternative Loader Styles
   ======================================== */

/* Pulsing circles */
.epd-loading-pulse {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.epd-pulse-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    position: absolute;
    top: 0;
    left: 0;
    animation:  epd-pulse 2s ease-in-out infinite;
}

.epd-pulse-circle:nth-child(2) {
    animation-delay: 0.5s;
}

.epd-pulse-circle:nth-child(3) {
    animation-delay: 1s;
}

@keyframes epd-pulse {
    0%, 100% {
        transform: scale(0);
        opacity: 0.8;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Wave loader */
.epd-wave-loader {
    display: flex;
    gap: 6px;
    margin: 0 auto 20px;
    justify-content: center;
}

.epd-wave-bar {
    width: 6px;
    height: 50px;
    background: white;
    border-radius: 3px;
    animation: epd-wave 1.2s ease-in-out infinite;
}

.epd-wave-bar:nth-child(1) { animation-delay: 0s; }
.epd-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.epd-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.epd-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.epd-wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes epd-wave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* ========================================
   Modern Dots Loader (Minimal)
   ======================================== */

.epd-dots-loader {
    display: flex;
    gap: 10px;
    margin: 0 auto 20px;
    justify-content: center;
}

.epd-dot {
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    animation:  epd-bounce 1.4s ease-in-out infinite;
}

.epd-dot:nth-child(1) { animation-delay: 0s; }
.epd-dot:nth-child(2) { animation-delay: 0.2s; }
.epd-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes epd-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .epd-loading-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .epd-loading-text {
        font-size: 18px;
    }
    
    .epd-loading-subtext {
        font-size:  13px;
    }
}

