/* ADS Plugin Styles - Scoped for Elementor Integration */
.ads-scope {
    all: initial;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: #111827 !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.ads-scope * {
    box-sizing: border-box;
}

.ads-scope .ads-creator-wrapper {
    max-width: 1120px;
    margin: 24px auto;
    width: 100%;
}

.ads-scope .ads-creator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.ads-scope .ads-badge-top {
    display: inline-block;
    background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    line-height: 1.4 !important;
}

.ads-scope .ads-creator-header h2 {
    margin: 0 0 4px 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}

.ads-scope .ads-creator-header p {
    margin: 0 !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.ads-scope .ads-wallet-topbar-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 12px 18px;
    border-radius: 12px;
}

.ads-scope .ads-wallet-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.25;
}

.ads-scope .ads-wallet-info span {
    font-size: 12px;
    color: #6b7280;
}

.ads-scope .ads-wallet-info small {
    font-size: 10px;
    color: #9ca3af;
}

.ads-scope .ads-btn-wallet-toggle {
    background: #059669 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    cursor: pointer !important;
    white-space: nowrap;
}

.ads-scope .ads-btn-wallet-toggle:hover {
    background: #047857 !important;
}

.ads-scope .ads-wallet-modal-card {
    background: #ffffff !important;
    border: 1px solid #059669 !important;
    border-radius: 14px !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.08);
}

.ads-scope .ads-wallet-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ads-scope .ads-wallet-modal-header h4 {
    margin: 0 !important;
    color: #065f46 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.ads-scope .ads-close-wallet-modal {
    background: transparent !important;
    border: none !important;
    font-size: 20px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
}

.ads-scope .ads-creator-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 860px) {
    .ads-scope .ads-creator-grid {
        grid-template-columns: 1fr;
    }
}

.ads-scope .ads-form-panel {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 24px !important;
}

.ads-scope .ads-section-box {
    margin-bottom: 22px !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.ads-scope .ads-section-box h4 {
    margin: 0 0 12px 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.4 !important;
}

.ads-scope .ads-field-desc {
    font-size: 13px !important;
    color: #6b7280 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.4 !important;
}

.ads-scope .ads-categories-checkboxes {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 14px !important;
}

.ads-scope .ads-cat-all-label {
    display: block !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    cursor: pointer;
}

.ads-scope .ads-cat-list-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
}

@media (max-width: 540px) {
    .ads-scope .ads-cat-list-grid {
        grid-template-columns: 1fr;
    }
}

.ads-scope .ads-cat-item {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    color: #374151 !important;
    cursor: pointer;
}

.ads-scope .ads-format-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 640px) {
    .ads-scope .ads-format-selector {
        grid-template-columns: 1fr 1fr;
    }
}

.ads-scope .ads-format-option {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 10px 8px !important;
    text-align: center;
    cursor: pointer;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #374151 !important;
    background: #ffffff !important;
    transition: all 0.15s ease;
}

.ads-scope .ads-format-option input {
    display: none;
}

.ads-scope .ads-format-option.active {
    border-color: #111827 !important;
    background: #f9fafb !important;
    color: #111827 !important;
}

.ads-scope .ads-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 540px) {
    .ads-scope .ads-field-row {
        grid-template-columns: 1fr;
    }
}

.ads-scope .ads-field {
    margin-bottom: 12px !important;
}

.ads-scope .ads-field label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    color: #374151 !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

.ads-scope .ads-field input[type="text"],
.ads-scope .ads-field input[type="url"],
.ads-scope .ads-field input[type="number"],
.ads-scope .ads-field select,
.ads-scope .ads-field textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #ffffff !important;
    color: #111827 !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: normal !important;
}

.ads-scope .ads-budget-box {
    border-bottom: none !important;
    background: #f9fafb !important;
    padding: 16px !important;
    border-radius: 10px !important;
}

.ads-scope .ads-total-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
}

.ads-scope .ads-total-display span {
    font-size: 12px !important;
    color: #6b7280 !important;
    line-height: 1.3 !important;
}

.ads-scope .ads-total-display strong {
    font-size: 20px !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}

.ads-scope .ads-btn-submit,
.ads-scope .ads-btn-primary {
    display: inline-block !important;
    width: 100% !important;
    background: #111827 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.ads-scope .ads-btn-submit:hover {
    background: #1f2937 !important;
}

.ads-scope .ads-feedback {
    padding: 12px !important;
    border-radius: 8px !important;
    margin-bottom: 14px !important;
    font-size: 13.5px !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* Tarjeta estilo Instagram / Redes */
.ads-scope .ads-preview-sticky {
    position: sticky;
    top: 24px;
}

.ads-scope .ads-preview-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280 !important;
    margin-bottom: 10px !important;
    text-align: center;
}

.ads-scope .ads-ig-card {
    max-width: 420px;
    margin: 0 auto;
    background: #ffffff !important;
    border: 1px solid #dbdbdb !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    text-align: left !important;
    display: flex;
    flex-direction: column;
}

.ads-scope .ads-ig-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #ffffff !important;
    order: 1;
}

.ads-scope .ads-ig-avatar-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    flex-shrink: 0;
}

.ads-scope .ads-ig-avatar-ring img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #ffffff !important;
    border: 2px solid #ffffff !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    max-width: none !important;
}

.ads-scope .ads-ig-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.ads-scope .ads-ig-brand-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #262626 !important;
}

.ads-scope .ads-verified-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50% !important;
    background: #0095f6 !important;
    color: #ffffff !important;
    font-size: 9px !important;
}

.ads-scope .ads-ig-sponsored {
    font-size: 12px !important;
    color: #737373 !important;
}

.ads-scope .ads-ig-media {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    overflow: hidden;
    order: 2;
    position: relative;
}

.ads-scope .ads-ig-media img,
.ads-scope .ads-ig-media video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: none !important;
}

.ads-scope .ads-youtube-embed-box iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.ads-scope .ads-ig-body {
    padding: 12px 14px 14px 14px;
    background: #ffffff !important;
    order: 3;
}

.ads-scope .ads-ig-title {
    font-weight: 700 !important;
    font-size: 14.5px !important;
    color: #111827 !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
}

.ads-scope .ads-ig-desc {
    font-size: 13.5px !important;
    color: #374151 !important;
    line-height: 1.4 !important;
    word-break: break-word;
}

.ads-scope .ads-ig-cta-bar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    order: 4;
}

/* Banner Flotante */
.ads-scope .ads-floating-box {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 340px !important;
    z-index: 999999 !important;
    background: transparent !important;
}

.ads-scope .ads-floating-close {
    position: absolute !important;
    top: -12px !important;
    right: -12px !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background: #111827 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    cursor: pointer !important;
    font-size: 16px !important;
    line-height: 1 !important;
    z-index: 1000000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Historial */
.ads-scope .ads-user-campaigns {
    margin-top: 32px;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 22px !important;
}

.ads-scope .ads-user-campaigns h3 {
    margin: 0 0 14px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

.ads-scope .ads-table-responsive {
    overflow-x: auto;
}

.ads-scope .ads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px !important;
    text-align: left !important;
}

.ads-scope .ads-table th,
.ads-scope .ads-table td {
    padding: 11px 12px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    color: #111827 !important;
}

.ads-scope .ads-status-badge {
    display: inline-block !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
}

.ads-scope .badge-green { background: #dcfce7 !important; color: #166534 !important; }
.ads-scope .badge-amber { background: #fef3c7 !important; color: #92400e !important; }
.ads-scope .badge-blue  { background: #dbeafe !important; color: #1e40af !important; }
.ads-scope .badge-red   { background: #fee2e2 !important; color: #991b1b !important; }
.ads-scope .badge-gray  { background: #f3f4f6 !important; color: #374151 !important; }

.ads-scope .ads-login-notice {
    max-width: 480px;
    margin: 30px auto;
    padding: 28px;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    text-align: center;
}

/* Acciones */
.ads-scope .ads-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.ads-scope .ads-btn-edit-ad {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ads-scope .ads-btn-edit-ad:hover { background: #e5e7eb !important; }

.ads-scope .ads-btn-cancel-ad {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ads-scope .ads-btn-cancel-ad:hover { background: #fee2e2 !important; }

.ads-scope .ads-edit-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.65);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ads-scope .ads-edit-modal-box {
    background: #ffffff !important;
    width: 100%;
    max-width: 540px;
    border-radius: 14px !important;
    padding: 24px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.ads-scope .ads-btn-cancel {
    background: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

/* Vista previa YouTube: reproductor horizontal 16:9 */
.ads-scope .ads-ig-card.ads-youtube-preview {
    width: min(100%, 420px);
    max-width: 420px;
}
.ads-scope .ads-youtube-preview .ads-ig-media {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    min-height: 0 !important;
}
.ads-scope .ads-youtube-preview .ads-ig-media > img,
.ads-scope .ads-youtube-preview .ads-ig-media > video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}
.ads-scope .ads-youtube-preview .ads-reel-overlay { display:none !important; }

/* Vista previa vertical estilo Instagram Reels */
.ads-scope .ads-reel-overlay { display: none; }
.ads-scope .ads-ig-card.ads-reel-preview {
    width: min(100%, 340px);
    max-width: 340px;
    aspect-ratio: 9 / 16;
    min-height: 0;
    height: auto;
    position: relative;
    display: block;
    background: #050505 !important;
    border: 1px solid #222 !important;
    border-radius: 16px;
    color: #fff !important;
}
.ads-scope .ads-reel-preview .ads-ig-header,
.ads-scope .ads-reel-preview .ads-ig-body,
.ads-scope .ads-reel-preview .ads-ig-cta-bar { display: none !important; }
.ads-scope .ads-reel-preview .ads-ig-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    order: initial;
    background: #050505;
}
.ads-scope .ads-reel-preview .ads-ig-media > img,
.ads-scope .ads-reel-preview .ads-ig-media > video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.ads-scope .ads-reel-preview .ads-reel-overlay {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    color: #fff;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, transparent 32%, rgba(0,0,0,.12) 48%, rgba(0,0,0,.78) 100%);
}
.ads-scope .ads-reel-side-actions {
    position: absolute;
    right: 12px;
    bottom: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-shadow: 0 1px 4px #000;
}
.ads-scope .ads-reel-side-actions span { display:flex; flex-direction:column; align-items:center; gap:2px; }
.ads-scope .ads-reel-side-actions b { font-size: 27px; line-height: 1; font-weight: 400; }
.ads-scope .ads-reel-side-actions small { font-size: 9px; color:#fff; }
.ads-scope .ads-reel-bottom { position:absolute; left:14px; right:58px; bottom:22px; text-shadow:0 1px 4px #000; }
.ads-scope .ads-reel-account { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-bottom:9px; }
.ads-scope .ads-reel-account img {
    display:block !important; flex:0 0 29px !important;
    width:29px !important; min-width:29px !important; max-width:29px !important;
    height:29px !important; min-height:29px !important; max-height:29px !important;
    aspect-ratio:1 / 1 !important; border-radius:50% !important;
    object-fit:contain !important; object-position:center !important;
    overflow:hidden !important; background:#fff !important; border:1px solid #fff !important;
}
.ads-scope .ads-reel-account strong { color:#fff; font-size:12px; font-weight:700; }
.ads-scope .ads-reel-sponsored { color:#fff; font-size:10px; opacity:.9; }
.ads-scope .ads-reel-description { color:#fff; font-size:11px; line-height:1.35; margin-bottom:12px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.ads-scope .ads-reel-cta { display:flex; align-items:center; justify-content:space-between; gap:8px; border-radius:9px; padding:11px 13px; color:#fff; font-size:12px; font-weight:700; text-shadow:none; }
.ads-scope .ads-reel-cta b { font-size:20px; line-height:12px; }
.ads-scope .ads-reel-audio { position:absolute; right:12px; bottom:12px; color:#fff; font-size:9px; text-shadow:0 1px 4px #000; }
@media (max-width: 540px) {
    .ads-scope .ads-ig-card.ads-reel-preview { width:min(100%, 300px); }
}
