/**
 * LinkedIn Feeds CSS
 *
 * Styles for the LinkedIn feed display
 */

/* Prefixar tudo com .linkedin-feed garante especificidade (0,2,0) ou maior,
   sobrepondo estilos genéricos do tema que usam (0,1,0). */

html .linkedin-feed {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

.linkedin-feed .linkedin-post {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.linkedin-feed .linkedin-post-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.linkedin-feed .linkedin-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    background: #f3f2ef;
}

.linkedin-feed .linkedin-post-meta {
    display: flex;
    flex-direction: column;
}

.linkedin-feed .linkedin-post-author {
    font-weight: 600;
    color: #333;
    line-height: normal !important;
    font-size: 14px;
}

.linkedin-feed .linkedin-post-date {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    line-height: normal !important;
}

.linkedin-feed .linkedin-post-content {
    padding: 12px;
}

.linkedin-feed .linkedin-post-text {
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.linkedin-feed .linkedin-post-text p {
    margin-bottom: 10px !important;
}

.linkedin-feed .linkedin-post-text p:last-child {
    margin-bottom: 0;
}

.linkedin-feed .linkedin-mention {
    color: #0a66c2;
    font-weight: 600;
}

.linkedin-feed .linkedin-hashtag {
    color: #0a66c2;
    font-weight: 600;
}

/* Limitador de linhas via CSS line-clamp (ativado pelo atributo char_limit no shortcode) */
.linkedin-feed[data-lines] .linkedin-post-text {
    display: -webkit-box;
    -webkit-line-clamp: var(--lf-lines, 6);
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.linkedin-feed .linkedin-post-media-wrapper {
    line-height: 0;
}

.linkedin-feed .linkedin-post-media {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.linkedin-feed .linkedin-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.linkedin-feed .linkedin-post-actions-right {
    margin-left: auto;
}

.linkedin-feed .linkedin-post-external-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
    white-space: nowrap;
}

.linkedin-feed .linkedin-post-external-link:hover {
    color: #005177;
    text-decoration: underline;
}

.linkedin-feed .linkedin-post-external-link svg {
    flex-shrink: 0;
}

.linkedin-feed .linkedin-post-likes,
.linkedin-feed .linkedin-post-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.linkedin-feed .linkedin-post-likes svg,
.linkedin-feed .linkedin-post-comments svg {
    opacity: 0.7;
}

.linkedin-feed .linkedin-post-stats {
    font-size: 12px;
    color: #666;
}

/* Slider Template */
html .linkedin-feed--slider {
    position: relative;
    padding-bottom: 36px;
}

/* Slides de mesma altura: stretch alinha os slides pela maior altura */
.linkedin-feed--slider .swiper-wrapper {
    align-items: stretch;
    padding-bottom: 48px;
}

.linkedin-feed--slider .swiper-slide {
    display: flex;
    height: auto;
}

/* O card ocupa 100% da altura do slide */
.linkedin-feed--slider .swiper-slide .linkedin-post {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    margin-bottom: 0;
}

/* Empurra o footer para o rodapé do card */
.linkedin-feed--slider .swiper-slide .linkedin-post-actions,
.linkedin-feed--slider .swiper-slide .linkedin-post-footer {
    margin-top: auto;
}

/* O conteúdo de texto cresce para preencher o espaço */
.linkedin-feed--slider .swiper-slide .linkedin-post-content {
    flex: 1;
}

.linkedin-feed--slider .linkedin-feed-pagination {
    bottom: 4px !important;
}

.linkedin-feed .linkedin-feed-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    z-index: 2;
}

.linkedin-feed .linkedin-feed-navigation::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    margin: 0 auto;
}

.linkedin-feed .linkedin-feed-navigation--prev {
    left: 8px;
}

.linkedin-feed .linkedin-feed-navigation--prev::before {
    transform: rotate(-135deg);
}

.linkedin-feed .linkedin-feed-navigation--next {
    right: 8px;
}

.linkedin-feed .linkedin-feed-navigation--next::before {
    transform: rotate(45deg);
}

/* Compact Template */
.linkedin-feed .linkedin-post--compact {
    padding: 12px 16px;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-content {
    padding: 0 0 12px 0;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-author {
    font-weight: 600;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-date::before {
    content: '•';
    margin-right: 8px;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-stats {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.linkedin-feed .linkedin-post--compact .linkedin-post-external-link {
    margin-left: auto;
    font-size: 12px;
}

/* Error & Empty States */
.linkedin-feed-error,
.linkedin-feed-empty {
    padding: 20px;
    text-align: center;
    background: #f8f8f8;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

.linkedin-feed-error {
    background: #fef2f2;
    color: #dc2626;
}

/* Admin Page */
.linkedin-shortcode-preview #sg-result {
    background: #f1f1f1;
    cursor: text;
}

.linkedin-vanity-lookup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.linkedin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.linkedin-status-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.linkedin-status-badge--connected {
    background: #edfbee;
    color: #276f2c;
    border: 1px solid #a8e6ab;
}

.linkedin-status-badge--connected .linkedin-status-badge__dot {
    background: #46b450;
}

.linkedin-status-badge--disconnected {
    background: #fef2f2;
    color: #9b1c1c;
    border: 1px solid #fca5a5;
}

.linkedin-status-badge--disconnected .linkedin-status-badge__dot {
    background: #dc3232;
}

.linkedin-feeds-admin {
    width: 95%;
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Poppins', sans-serif;
}

.linkedin-feeds-admin .linkedin-feeds-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.linkedin-feeds-admin .linkedin-feeds-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.linkedin-feeds-admin .linkedin-feeds-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.linkedin-feeds-admin code {
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Shortcode preview box (estilo CF7) */
.linkedin-shortcode-box {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.linkedin-shortcode-box__label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #23282d;
    margin-bottom: 8px;
}

.linkedin-shortcode-box__row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.linkedin-shortcode-box__input {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    background: #fff;
    color: #23282d;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 5px 8px;
    min-width: 0;
}

.linkedin-shortcode-box .description {
    margin: 8px 0 0;
    font-size: 12px;
    color: #666;
}

/* Toggle switch */
.linkedin-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.linkedin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.linkedin-toggle-slider {
    position: absolute;
    inset: 0;
    background: #e7edfc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.linkedin-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.linkedin-toggle input:checked+.linkedin-toggle-slider {
    background: #0048FF;
}

.linkedin-toggle input:checked+.linkedin-toggle-slider::before {
    transform: translateX(20px);
}

.linkedin-pages-table {
    margin-top: 12px;
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

.linkedin-pages-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
}

.linkedin-pages-table td {
    padding: 8px 10px;
    vertical-align: middle;
    word-break: break-all;
}

.linkedin-pages-table tr:last-child td {
    border-bottom: none;
}

.linkedin-connection-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 0;
    gap: 10px;
}

.linkedin-connection-status__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.linkedin-connection-status__icon svg {
    width: 28px;
    height: 28px;
}

.linkedin-connection-status__icon--connected {
    background: #edfbee;
    color: #276f2c;
}

.linkedin-connection-status__icon--disconnected {
    background: #fef2f2;
    color: #9b1c1c;
}

.linkedin-connection-status__description {
    margin: 0;
    font-size: 13px;
    color: #666;
    max-width: 280px;
}

.linkedin-submit--center {
    text-align: center !important;
}

.form-table .description {
    font-size: 12px;
}

/* Responsive */
@media (min-width: 992px) {
    .linkedin-feed .linkedin-post-header {
        padding: 16px;
    }

    .linkedin-feed .linkedin-post-avatar {
        width: 48px;
        height: 48px;
    }

    .linkedin-feed .linkedin-post-content {
        padding: 16px;
    }

    .linkedin-feed .linkedin-post-actions {
        padding: 12px 16px;
        gap: 24px;
    }
}