:root {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2128;
    --border-color: #30363d;
    --border-subtle: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #2f81f7;
    --accent-green: #238636;
    --accent-green-glow: rgba(35, 134, 54, 0.4);
    --accent-orange: #d29922;
    --accent-purple: #a371f7;
    --accent-red: #f85149;
    --wa-color: #25d366;
    --ig-color: #e1306c;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    overflow-x: hidden; /* Proibido scroll horizontal */
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header & Barra Superior */
.header {
    background: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 16px;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .header-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2f81f7, #238636);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-realtime {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #3fb950;
    background: rgba(63, 185, 80, 0.12);
    border: 1px solid rgba(63, 185, 80, 0.3);
    padding: 3px 8px;
    border-radius: 20px;
}

.badge-realtime .dot {
    width: 7px;
    height: 7px;
    background-color: #3fb950;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green-glow);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Botões Gerais */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-green);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-primary:hover {
    background-color: #2ea043;
}

.btn-secondary {
    background-color: #21262d;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #30363d;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

/* Botões de Redes Sociais Diretas (WhatsApp e Instagram) */
.btn-wa {
    background-color: #128c7e;
    color: #fff;
}
.btn-wa:hover {
    background-color: #075e54;
}

.btn-ig {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}
.btn-ig:hover {
    opacity: 0.9;
}

/* Barra de Filtros e Busca */
.controls-bar {
    max-width: 1300px;
    margin: 16px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    .controls-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent-blue);
}

.count-badge {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background-color: #21262d;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Container Principal e Cards */
.main-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 16px 80px 16px;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Card Individual de Concorrente */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.15s, border-color 0.15s;
    word-break: break-word;
}

.card:hover {
    border-color: #58a6ff;
    background-color: var(--bg-card-hover);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-hotmart { background: rgba(227, 90, 36, 0.2); color: #ff7849; border: 1px solid rgba(227, 90, 36, 0.4); }
.tag-kiwify { background: rgba(35, 134, 54, 0.2); color: #3fb950; border: 1px solid rgba(35, 134, 54, 0.4); }
.tag-onprofit { background: rgba(56, 139, 253, 0.2); color: #58a6ff; border: 1px solid rgba(56, 139, 253, 0.4); }
.tag-encapsulado { background: rgba(163, 113, 247, 0.2); color: #d2a8ff; border: 1px solid rgba(163, 113, 247, 0.4); }
.tag-default { background: #21262d; color: var(--text-secondary); border: 1px solid var(--border-color); }
.tag-price { background: rgba(210, 153, 34, 0.18); color: #e3b341; border: 1px solid rgba(210, 153, 34, 0.4); font-weight: 700; }
.tag-nicho { background: #21262d; color: #a5d6ff; border: 1px solid #30363d; }

.card-promise {
    background: #0d1117;
    border-left: 3px solid var(--accent-blue);
    padding: 8px 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.83rem;
    color: #c9d1d9;
    font-style: italic;
}

/* Área de Links Diretos (O foco principal do sistema) */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(13, 17, 23, 0.7);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.links-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.12s;
    background-color: #21262d;
    border: 1px solid var(--border-color);
}

.link-btn:hover {
    background-color: #30363d;
    transform: translateY(-1px);
}

.link-btn-ads {
    border-left: 3px solid #1877f2;
    color: #79c0ff;
}
.link-btn-pv {
    border-left: 3px solid #238636;
    color: #7ee787;
}
.link-btn-comp {
    border-left: 3px solid #d29922;
    color: #e3b341;
}
.link-btn-adv {
    border-left: 3px solid #a371f7;
    color: #d2a8ff;
}

.link-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Detalhes Expansíveis (Hooks, Ângulos, Upsell) */
.card-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.details-toggle {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.details-content {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
}

.detail-block strong {
    color: var(--text-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.detail-block p {
    white-space: pre-line;
    color: #8b949e;
    background: #0d1117;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    margin-top: auto;
}

.card-actions {
    display: flex;
    gap: 6px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    padding: 20px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-col-span-2 {
        grid-column: span 2;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 8px 10px;
    background-color: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent-blue);
}

.form-textarea {
    min-height: 70px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* Toast Notificações */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f6feb;
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* LGPD Modal & Info */
.lgpd-banner {
    max-width: 1300px;
    margin: 10px auto 0 auto;
    padding: 8px 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

