/*==Instagram Integration Styles=====================*/

/* Instagram Suggestions */
.instagram-suggestions {
    position: absolute;
    z-index: 1000;
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.instagram-suggestions.hidden {
    display: none;
}

.instagram-suggestions.show {
    display: block;
}

.instagram-suggestions-list {
    padding: 8px;
}

.instagram-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.instagram-suggestion-item:hover {
    background: #f3f4f6;
}

.suggestion-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.suggestion-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
}

.suggestion-username {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.suggestion-fullname {
    font-size: 12px;
    color: #6b7280;
}

/* Instagram Preview */
[data-instagram-preview] {
    display: none;
}

[data-instagram-preview].show {
    display: block;
}

.instagram-profile-preview {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.instagram-profile-preview--followers {
    position: relative;
    padding: 2px;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.instagram-profile-preview--followers .instagram-profile-preview__border {
    position: absolute;
    inset: -100%;
    background: conic-gradient(from 0deg, #3d01e700, #33b4ea, #c20088, #e7011700);
    animation: igProfileBorderSpin 2.8s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.instagram-profile-preview--followers .instagram-profile-preview__inner {
    position: relative;
    z-index: 1;
    background: #f9fafb;
    padding: 16px;
    border-radius: 11px;
}

.instagram-profile-preview--animating .stat-item--followers .stat-label {
    color: #9333ea;
}

@keyframes igProfileBorderSpin {
    to {
        transform: rotate(360deg);
    }
}

.stat-item--followers .stat-number {
    transition: color 0.25s ease, transform 0.25s ease;
}

.stat-number--boosting {
    color: #9333ea !important;
    display: inline-block;
    transform: scale(1.12);
    animation: igFollowerCountPulse 0.55s ease-in-out infinite alternate;
}

@keyframes igFollowerCountPulse {
    from {
        transform: scale(1.05);
        text-shadow: 0 0 0 rgba(147, 51, 234, 0);
    }
    to {
        transform: scale(1.14);
        text-shadow: 0 0 12px rgba(147, 51, 234, 0.35);
    }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 8px;
}

.profile-stats {
    display: flex;
    gap: 16px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    display: block;
}

.stat-label {
    font-size: 11px;
    color: #6b7280;
}

/* Posts e Reels Grid */
.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 12px;
}

.posts-grid,
.reels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.post-item,
.reel-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.post-item:hover,
.reel-item:hover {
    transform: scale(1.02);
    border-color: #3b82f6;
}

.post-item.selected,
.reel-item.selected {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.post-item.selected::after,
.reel-item.selected::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-size: 16px 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.post-image img,
.reel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-overlay,
.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 8px;
    color: white;
    font-size: 10px;
}

.post-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reel-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.views-count {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.instagram-view-more {
    text-align: center;
    margin-top: 12px;
}

.instagram-view-more-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.2s;
}

.instagram-view-more-btn:hover {
    background: #e5e7eb;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.skeleton-text-short {
    height: 10px;
    width: 60%;
    border-radius: 4px;
}

.skeleton-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 12px;
}

.skeleton-post-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.skeleton-grid--single {
    grid-template-columns: minmax(0, 320px);
    justify-content: center;
}

.skeleton-grid--single .skeleton-post-item {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 320 / 109;
    border-radius: 14px;
}

/* Errors and Warnings */
.instagram-suggestions-error,
.instagram-preview-error {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.instagram-private-warning {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.warning-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.warning-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.warning-content p {
    font-size: 12px;
    color: #78350f;
    margin: 0;
}

/* ===== EXTRAS (Pacotes Adicionais) ===== */
.extra-instagram-content {
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.extra-posts-grid,
.extra-reels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.extra-post-item,
.extra-reel-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.extra-post-item:hover,
.extra-reel-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.extra-post-item.selected,
.extra-reel-item.selected {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.extra-post-item.selected::after,
.extra-reel-item.selected::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-size: 16px 16px;
    background-position: center;
    background-repeat: no-repeat;
}

.extra-post-item img,
.extra-reel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.extra-post-overlay,
.extra-reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.extra-post-likes,
.extra-reel-views {
    font-size: 10px;
    color: white;
    font-weight: 600;
}

.checkout-publication-limit {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.checkout-publication-count,
.pergo-summary-multiplier {
    color: #7c3aed;
    font-weight: 800;
}

.pergo-summary-multiplier:empty {
    display: none;
}

/* Checkout Eleva — preview e seleção de publicações no tema Syntax dark */
body[data-pergo-page="checkout"] .instagram-suggestions {
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.48);
}

body[data-pergo-page="checkout"] .instagram-suggestion-item:hover {
    background: rgba(51, 65, 85, 0.62);
}

body[data-pergo-page="checkout"] .suggestion-username {
    color: #e2e8f0;
}

body[data-pergo-page="checkout"] .suggestion-fullname {
    color: #94a3b8;
}

body[data-pergo-page="checkout"] .instagram-profile-preview,
body[data-pergo-page="checkout"] .instagram-profile-preview--followers .instagram-profile-preview__inner {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.09), transparent 16rem),
        rgba(15, 23, 42, 0.86);
}

body[data-pergo-page="checkout"] .instagram-profile-preview--followers {
    background: rgba(15, 23, 42, 0.86);
}

body[data-pergo-page="checkout"] .instagram-profile-preview--followers .instagram-profile-preview__border {
    background: conic-gradient(
        from 0deg,
        rgba(56, 189, 248, 0),
        #38bdf8,
        #818cf8,
        rgba(56, 189, 248, 0)
    );
}

body[data-pergo-page="checkout"] .profile-avatar {
    border-color: rgba(125, 211, 252, 0.4);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

body[data-pergo-page="checkout"] .profile-username,
body[data-pergo-page="checkout"] .stat-number {
    color: #e2e8f0;
}

body[data-pergo-page="checkout"] .stat-label,
body[data-pergo-page="checkout"] .preview-title {
    color: #94a3b8;
}

body[data-pergo-page="checkout"] .instagram-profile-preview--animating .stat-item--followers .stat-label,
body[data-pergo-page="checkout"] .stat-number--boosting {
    color: #7dd3fc !important;
}

body[data-pergo-page="checkout"] .extra-instagram-content {
    padding: 0.75rem;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.75rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.07), transparent 13rem),
        rgba(15, 23, 42, 0.68);
}

body[data-pergo-page="checkout"] .extra-instagram-content > p,
body[data-pergo-page="checkout"] .extra-instagram-content .text-gray-700 {
    color: #cbd5e1 !important;
}

body[data-pergo-page="checkout"] .extra-post-item,
body[data-pergo-page="checkout"] .extra-reel-item {
    border-color: rgba(255, 255, 255, 0.08);
    background: #1e293b;
}

body[data-pergo-page="checkout"] .extra-post-item:hover,
body[data-pergo-page="checkout"] .extra-reel-item:hover {
    border-color: rgba(125, 211, 252, 0.42);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.36);
}

body[data-pergo-page="checkout"] .extra-post-item.selected,
body[data-pergo-page="checkout"] .extra-reel-item.selected {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

body[data-pergo-page="checkout"] .extra-post-item.selected::after,
body[data-pergo-page="checkout"] .extra-reel-item.selected::after {
    background-color: #38bdf8;
}

body[data-pergo-page="checkout"] .checkout-publication-limit {
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(14, 165, 233, 0.09);
}

body[data-pergo-page="checkout"] .checkout-publication-count,
body[data-pergo-page="checkout"] .pergo-summary-multiplier {
    color: #7dd3fc;
}

body[data-pergo-page="checkout"] .skeleton,
body[data-pergo-page="checkout"] .skeleton-post-item,
body[data-pergo-page="checkout"] .skeleton-grid--single .skeleton-post-item {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.82) 25%,
        rgba(71, 85, 105, 0.78) 50%,
        rgba(30, 41, 59, 0.82) 75%
    );
    background-size: 200% 100%;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

body[data-pergo-page="checkout"] .skeleton-suggestion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.56);
}

body[data-pergo-page="checkout"] .instagram-view-more-btn {
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.2);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

body[data-pergo-page="checkout"] .instagram-view-more-btn:hover {
    color: #e0f2fe;
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(14, 165, 233, 0.18);
}

body[data-pergo-page="checkout"] .post-item.selected,
body[data-pergo-page="checkout"] .reel-item.selected {
    border-color: #38bdf8;
    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.22),
        0 10px 24px rgba(2, 6, 23, 0.32);
}

body[data-pergo-page="checkout"] .post-item.selected::after,
body[data-pergo-page="checkout"] .reel-item.selected::after {
    background-color: #38bdf8;
}

/* Busca de perfil no modal da área do cliente */
body[data-pergo-page="client"] .instagram-suggestions {
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.48);
}

body[data-pergo-page="client"] .instagram-suggestion-item:hover {
    background: rgba(51, 65, 85, 0.62);
}

body[data-pergo-page="client"] .suggestion-username,
body[data-pergo-page="client"] .profile-username,
body[data-pergo-page="client"] .stat-number {
    color: #e2e8f0;
}

body[data-pergo-page="client"] .suggestion-fullname,
body[data-pergo-page="client"] .stat-label,
body[data-pergo-page="client"] .preview-title {
    color: #94a3b8;
}

body[data-pergo-page="client"] .instagram-profile-preview,
body[data-pergo-page="client"] .instagram-profile-preview--followers,
body[data-pergo-page="client"] .instagram-profile-preview--followers .instagram-profile-preview__inner {
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.09), transparent 16rem),
        rgba(15, 23, 42, 0.86);
}

body[data-pergo-page="client"] .instagram-profile-preview--followers .instagram-profile-preview__border {
    background: conic-gradient(from 0deg, rgba(56, 189, 248, 0), #38bdf8, #818cf8, rgba(56, 189, 248, 0));
}

/* Carregamento e paginação da busca de publicações na área do cliente */
body[data-pergo-page="client"] .instagram-view-more-btn {
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(99, 102, 241, 0.16));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 8px 20px rgba(2, 6, 23, 0.2);
}

body[data-pergo-page="client"] .instagram-view-more-btn:hover {
    color: #f0f9ff;
    border-color: rgba(125, 211, 252, 0.52);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(99, 102, 241, 0.28));
}

body[data-pergo-page="client"] .skeleton,
body[data-pergo-page="client"] .skeleton-post-item {
    border: 1px solid rgba(125, 211, 252, 0.08);
    background: linear-gradient(
        110deg,
        rgba(15, 23, 42, 0.9) 20%,
        rgba(51, 65, 85, 0.9) 42%,
        rgba(30, 41, 59, 0.92) 62%,
        rgba(15, 23, 42, 0.9) 82%
    );
    background-size: 240% 100%;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

body[data-pergo-page="client"] .skeleton-avatar {
    border: 1px solid rgba(125, 211, 252, 0.14);
}

body[data-pergo-page="client"] .skeleton-suggestion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.62);
}

body[data-pergo-page="client"] .skeleton-grid--single .skeleton-post-item {
    border-radius: 14px;
}

