/**
 * Partners and Speakers Shortcode Styles
 * Uses shared components to reduce redundancy
 */

/* Import shared components */
@import url('../wdm-shared-components.css');

/* Select2 Styles for Partners and Speakers Dropdowns */
#wdm_project_partners_community+.select2-container .select2-selection--multiple .select2-search--inline,
#wdm_project_speakers_community+.select2-container .select2-selection--multiple .select2-search--inline {
    display: inline-block;
    width: 100%;
    min-width: 150px;
}

#wdm_project_partners_community+.select2-container .select2-selection--multiple .select2-search--inline textarea,
#wdm_project_speakers_community+.select2-container .select2-selection--multiple .select2-search--inline textarea {
    border: none !important;
}

.wdm-select2-action-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.wdm-select2-action-row select,
.wdm-select2-action-row .select2-container {
    flex: 1 1 auto;
    min-width: 260px;
    width: 100%;
}

.wdm-select2-action-row select .selection,
.wdm-select2-action-row .select2-container .selection {
    display: flex !important;
}

.wdm-select2-action-row .select2-container .selection>* {
    flex: 1;
}

#wdm_project_partners_community+.select2-container .select2-selection--multiple,
#wdm_project_speakers_community+.select2-container .select2-selection--multiple {
    border: 2px solid var(--ast-global-color-8, #ed680a);
    border-radius: 12px;
    min-height: 54px;
    padding: 6px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #000;
}

#wdm_project_partners_community+.select2-container .select2-selection--multiple:focus-within,
#wdm_project_speakers_community+.select2-container .select2-selection--multiple:focus-within {
    border-color: var(--ast-global-color-8, #ed680a);
    box-shadow: 0 0 0 3px rgba(237, 104, 10, 0.2);
}

.wdm-add-partner-button-community,
.wdm-add-speaker-button-community {
    background-color: var(--ast-global-color-8, #ed680a);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(237, 104, 10, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    min-width: 200px;
    text-align: center;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.wdm-add-partner-button-community:hover,
.wdm-add-speaker-button-community:hover {
    transform: translateY(-2px) scale(1.05);
}

.wdm-add-partner-button-community:focus-visible,
.wdm-add-speaker-button-community:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 104, 10, 0.35);
}

.wdm-select2-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.wdm-select2-chip-avatar {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--ast-global-color-8, #ed680a);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    background: #fff;
}

.wdm-select2-chip-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: inherit;
}

#wdm_project_partners_community+.select2-container .select2-selection__choice,
#wdm_project_speakers_community+.select2-container .select2-selection__choice {
    background: rgba(237, 104, 10, 0.08) !important;
    border: 1px solid var(--ast-global-color-8, #ed680a) !important;
    color: #1a1a1a !important;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    margin: 5px 3px !important;
    min-height: 46px !important;
    height: 46px !important;
    box-sizing: border-box !important;
}

#wdm_project_partners_community+.select2-container .select2-selection__choice__remove,
#wdm_project_speakers_community+.select2-container .select2-selection__choice__remove {
    color: var(--ast-global-color-8, #ed680a) !important;
    border: none !important;
    margin-top: 13px !important;
    font-size: 16px;
    margin-left: 3px;
}

.tribe-community-events .wdm-select2-action-row .wdm-add-partner-button-community.button,
.tribe-community-events .wdm-select2-action-row .wdm-add-speaker-button-community.button {
    background-color: var(--ast-global-color-8, #ed680a) !important;
    border-color: var(--ast-global-color-8, #ed680a) !important;
    color: #fff !important;
}

/* Select2 Dropdown Results Styling for Partners/Speakers */
.wdm-select2-partners-community+.select2-container .select2-results__option,
.wdm-select2-speakers-community+.select2-container .select2-results__option,
#wdm_project_partners_community+.select2-container .select2-results__option,
#wdm_project_speakers_community+.select2-container .select2-results__option {
    color: #000;
    padding: 8px 12px;
}

.wdm-select2-partners-community+.select2-container .select2-results__option--highlighted,
.wdm-select2-speakers-community+.select2-container .select2-results__option--highlighted,
#wdm_project_partners_community+.select2-container .select2-results__option--highlighted,
#wdm_project_speakers_community+.select2-container .select2-results__option--highlighted {
    background-color: var(--ast-global-color-8, #ed680a) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable .wdm-select2-option-secondary {
    color: #fff;
}

.wdm-select2-partners-community+.select2-container .select2-results__option--highlighted .wdm-status-badge,
.wdm-select2-speakers-community+.select2-container .select2-results__option--highlighted .wdm-status-badge,
#wdm_project_partners_community+.select2-container .select2-results__option--highlighted .wdm-status-badge,
#wdm_project_speakers_community+.select2-container .select2-results__option--highlighted .wdm-status-badge {
    background: #fff;
    color: var(--ast-global-color-8, #ed680a);
}

/* Select2 Option Template Styles */
.wdm-select2-option {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wdm-select2-option-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--ast-global-color-8, #ed680a);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.wdm-select2-option-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wdm-select2-option-primary {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
}

.wdm-select2-option-secondary {
    color: #000;
    font-size: 0.85rem;
}

.wdm-status-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f0ad4e;
    color: #fff;
}

.wdm-status-badge.wdm-status-pending {
    background: #f0ad4e;
    color: #fff;
}

.wdm-delete-legacy-partner-community,
.wdm-delete-legacy-speaker-community {
    cursor: pointer;
}

.wdm-delete-legacy-partner-community:hover,
.wdm-delete-legacy-speaker-community:hover {
    opacity: 0.8;
}

.tribe-community-events .wdm-custom-tribe-section .tribe-section-content-field div.wdm-legacy-partner-row,
.tribe-community-events .wdm-custom-tribe-section .tribe-section-content-field div.wdm-legacy-speaker-row {
    margin-top: 40px !important;
}

/* Specific overrides for partners/speakers */
.wdm-partners-speakers-wrap {
    /* Inherits from .wdm-shared-wrap */
}

.wdm-partners-speakers {
    /* Inherits from .wdm-shared-container */
}

.wdm-partners-speakers-data {
    /* Inherits from .wdm-shared-data */
}

.wdm-partners-speakers-controls {
    /* Inherits from .wdm-shared-controls */
}

.wdm-partners-speakers-grid {
    /* Inherits from .wdm-shared-grid */
}

.wdm-partner-speaker-card {
    /* Inherits from .wdm-shared-card */
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid #e1e4e5;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    /* Add margin between cards */
}

.wdm-partner-speaker-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ast-global-color-8), #171955);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.wdm-partner-speaker-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--ast-global-color-8);
}

.wdm-partner-speaker-card:hover::before {
    transform: scaleX(1);
}

/* Enhanced card layout - New Structure */
.wdm-card-upper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 0px;
}

.wdm-card-upper-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    /* Allow flex item to shrink */
}

.wdm-card-upper-right {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    /* Prevent right column from shrinking */
}

.wdm-card-lower {
    border-top: 1px solid #e1e4e5;
    padding-top: 15px;
}

/* Legacy support removed - using new card structure */

/* Image styling with proper aspect ratio preservation */
.wdm-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e1e4e5;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Prevent image container from shrinking */
}

/* Speaker-specific image styling - circular */
.wdm-speaker-image {
    border-radius: 50% !important;
    /* Make speaker images circular */
    width: 100px;
    height: 100px;
    border: 2px solid #e1e4e5;
    overflow: hidden;
}

/* Speaker images should use cover for better circular appearance */
.wdm-speaker-image .wdm-partner-speaker-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
    object-position: center;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.wdm-image:hover {
    border-color: var(--ast-global-color-8, #0073aa);
    transform: scale(1.05);
}

.wdm-partner-speaker-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to contain to prevent cropping */
    object-position: center;
    transition: transform 0.3s ease;
    max-width: 100%;
    max-height: 100%;
}

.wdm-partner-speaker-image:hover {
    transform: scale(1.1);
}

/* Enhanced title styling */
.wdm-partner-speaker-card .wdm-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Speaker-specific title and affiliation styling */
.wdm-speaker-title {
    font-size: 16px;
    color: #666666;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.wdm-speaker-affiliation {
    font-size: 14px;
    color: #666666;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* Abbreviation styling - greyish color */
.wdm-abbreviation-text {
    color: #666666;
    font-weight: 400;
}

/* Enhanced field styling */
.wdm-abbreviation,
.wdm-association {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--ast-global-color-8, #0073aa);
}

.wdm-abbreviation-label,
.wdm-association-label {
    font-weight: 600;
    color: var(--ast-global-color-8, #0073aa);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced website styling - simplified */
.wdm-website {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wdm-website:hover {
    /* No background or border changes on hover */
}

.wdm-website .dashicons {
    color: #666;
    font-size: 16px;
}

.wdm-website a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.wdm-website a:hover {
    text-decoration: underline;
    color: #666;
}

/* Enhanced linked projects styling - simplified */
.wdm-linked-projects {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

h6.wdm-projects-label {
    font-size: 15px;
    margin-bottom: 0;
    color: #000;
}

.wdm-project-link {
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wdm-project-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

/* Enhanced date styling */
.wdm-date-created {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.wdm-date-created .dashicons {
    color: var(--ast-global-color-8, #0073aa);
    font-size: 14px;
}

/* Enhanced controls styling */
.wdm-partners-speakers-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    background: white;
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced search box styling */
.wdm-search-box {
    transition: all 0.3s ease;
}

/* Dual search fields for speakers */
.wdm-speaker-search {
    display: flex;
    gap: 15px;
    align-items: center;
}

.wdm-search-field {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.wdm-search-field:hover {
    border-color: var(--ast-global-color-8, #0073aa);
}

.wdm-search-field:focus-within {
    border-color: var(--ast-global-color-8, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.wdm-search-field .dashicons {
    color: #666;
    font-size: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.wdm-search-field .wdm-search-input {
    border: none !important;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    width: 100%;
    padding: 0;
}

.wdm-search-field .wdm-search-input::placeholder {
    color: #999;
}

/* Enhanced download buttons - using original color */
.wdm-download-btn {
    padding: 8px 16px;
    background-color: #171955;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.wdm-download-btn:hover {
    background-color: #0f1238;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wdm-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wdm-download-btn:focus {
    outline: none;
    background-color: #171955;
    color: white;
}

.wdm-download-btn .dashicons {
    font-size: 14px;
    opacity: 0.8;
    width: 10px;
    height: 15px;
}

/* Enhanced pagination styling */
.wdm-total-entries {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #e1e4e5;
    font-size: 14px;
    color: #666;
}

.wdm-entries-info {
    font-weight: 500;
}

.wdm-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.wdm-pagination button {
    padding: 12px;
    border: 1px solid #d4d4d4;
    background: none;
    color: #666;
    cursor: pointer;
    border-radius: 100%;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdm-pagination button:hover:not(:disabled) {
    background-color: var(--ast-global-color-8);
    color: white;
    border-color: var(--ast-global-color-8);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wdm-pagination button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wdm-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wdm-pagination button.current-page {
    background-color: var(--ast-global-color-8);
    color: white;
    border: 1px solid var(--ast-global-color-8);
    font-weight: 600;
    cursor: default;
    pointer-events: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Loading State */
.wdm-partners-speakers-grid.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wdm-partners-speakers-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ast-global-color-8, #0073aa);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Fade In Animation */
.wdm-partner-speaker-card {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wdm-partner-speaker-card {
        flex-direction: column;
        /* Stack vertically on mobile */
        gap: 15px;
        padding: 15px;
    }

    .wdm-website {
        justify-content: center;
    }

    .wdm-card-upper {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .wdm-card-upper-left {
        text-align: center;
    }

    .wdm-card-lower {
        border-top: 1px solid #e1e4e5;
        padding-top: 15px;
    }

    .wdm-image {
        width: 80px;
        height: 80px;
    }

    .wdm-speaker-image {
        width: 80px;
        height: 80px;
    }

    .wdm-partner-speaker-card .wdm-card-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .wdm-card-upper {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .wdm-card-upper-left {
        text-align: center;
    }

    .wdm-image {
        width: 60px;
        height: 60px;
    }

    .wdm-speaker-image {
        width: 60px;
        height: 60px;
    }

    .wdm-partner-speaker-card .wdm-card-title {
        font-size: 16px;
    }
}

/* Responsive design for dual search fields */
@media (max-width: 768px) {
    .wdm-speaker-search {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .wdm-search-field {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .wdm-speaker-search {
        flex-direction: column;
        gap: 8px;
    }

    .wdm-search-field {
        width: 100%;
    }
}