/* Reset e Padrões Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

/* Cabeçalho */
.main-header {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.main-header h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(45deg, #1877f2, #3b5998);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Relatório Geral */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 0 5px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.summary-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Barra de Filtros */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    padding: 20px;
    background-color: #f7f8fa;
    border: 1px solid #dddfe2;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 13px;
    font-weight: 600;
    color: #606770;
}

.filter-item select,
.filter-item input {
    padding: 8px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.btn {
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #1877f2;
    color: white;
}
.btn-primary:hover {
    background-color: #166fe5;
}

.btn-secondary {
    background-color: #e4e6eb;
    color: #1c1e21;
}
.btn-secondary:hover {
    background-color: #d8dbdf;
}


/* Tabela de Campanhas */
.campaigns-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.campaigns-table th,
.campaigns-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dddfe2;
    font-size: 14px;
    vertical-align: middle;
}

.campaigns-table th {
    background-color: #f7f8fa;
    color: #606770;
    font-weight: 600;
}

.campaigns-table tr:hover {
    background-color: #f7f8fa;
}

.campaigns-table td:first-child {
    font-weight: 600;
    color: #1c1e21;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #1877f2;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
}
.link-button:hover {
    text-decoration: underline;
}

.campaigns-table tfoot tr {
    background-color: #f7f8fa;
    border-top: 2px solid #dddfe2;
}

.campaigns-table tfoot td {
    font-weight: 700;
    color: #1c1e21;
}

/* Tabela aninhada para conjuntos */
.adsets-container { padding: 10px 5px; }
.nested-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}
.nested-table th,
.nested-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e6e6e6;
    font-size: 13px;
}
.adsets-empty { color: #606770; font-size: 13px; padding: 10px 0; }
.adsets-error { color: #fa383e; font-size: 13px; padding: 10px 0; }

/* Estilos de Status */
.status-cell span {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    color: #fff;
    text-transform: uppercase;
}
.status-active { background-color: #42b72a; }
.status-paused { background-color: #f7b928; }
.status-archived { background-color: #90949c; }
.status-deleted { background-color: #fa383e; }

/* Estilos Condicionais Custo por Conversa */
.cpc-good, .cpc-warning, .cpc-bad {
    padding: 6px 10px;
    border-radius: 4px;
    text-align: center;
    color: #fff;
    font-weight: bold;
}
.cpc-good { background-color: #2ab736; } /* Verde */
.cpc-warning { background-color: #f7b928; } /* Laranja */
.cpc-bad { background-color: #fa383e; } /* Vermelho */


/* Notificações e Loading */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 16px;
    color: #606770;
}

#notification {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
#notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
#notification.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
#notification.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

/* Seção de Gráficos */
.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dddfe2;
}
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    height: 400px;
}
.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1c1e21;
}

/* Container para a Tabela para Rolagem Horizontal */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Melhora a experiência de rolagem no iOS */
}

/* Skeleton Loader */
.skeleton-row td .skeleton-item {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    animation: shimmer 1.5s infinite linear;
    background-image: linear-gradient(90deg, #e9ecef 0px, #f6f7f8 40px, #e9ecef 80px);
    background-size: 600px;
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Media Queries for Responsiveness */
@media (max-width: 992px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-summary {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }

    .campaigns-table th,
    .campaigns-table td {
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap; /* Impede a quebra de linha dentro das células */
    }
    
    .report-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .summary-card {
        padding: 18px;
    }
    
    .summary-icon {
        font-size: 2rem;
    }
    
    .summary-value {
        font-size: 1.3rem;
    }
    
    .summary-label {
        font-size: 0.8rem;
    }
} 

/* Estilos para o botão de toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin: 0 auto;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4CAF50; /* Verde para Ativo */
}

input:disabled + .toggle-slider {
    cursor: not-allowed;
    background-color: #e0e0e0;
}


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

/* Adicionando estilo desativado */
.toggle-switch input:disabled + .toggle-slider {
    background-color: #dddddd;
    cursor: not-allowed;
}

.toggle-switch input:disabled + .toggle-slider:before {
    background-color: #bbbbbb;
} 

/* ========================================
   NOVOS ESTILOS PARA FUNCIONALIDADES AVANÇADAS
   ======================================== */

/* Botões adicionais */
.btn-success {
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #218838;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}
.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}
.btn-warning:hover {
    background-color: #e0a800;
}

/* Container de Alertas */
.alerts-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    position: relative;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert .close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
}

/* Métricas Avançadas */
.advanced-metrics-section {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.advanced-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1877f2;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Comparação de Períodos */
.period-comparison-section {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    border: 1px solid #90caf9;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.comparison-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.comparison-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.comparison-value {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.comparison-value.positive {
    color: #28a745;
}

.comparison-value.negative {
    color: #dc3545;
}

.comparison-value .change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.1);
}

/* Melhorias na responsividade */
@media (max-width: 768px) {
    .advanced-metrics-grid,
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-card,
    .comparison-item {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 1.3rem;
    }
    
    .comparison-value {
        font-size: 1.1rem;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-item select,
    .filter-item input {
        width: 100%;
        min-width: auto;
    }
}

/* Animações suaves */
.alert,
.metric-card,
.comparison-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Melhorias nos botões */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Loading melhorado */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    color: #606770;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   ESTILOS PARA CONTA GERAL
   ======================================== */

/* Badge da conta na visualização GERAL */
.account-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeInUp 0.3s ease-out;
}

/* Melhoria no link-button para acomodar o badge */
.link-button {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    color: #1877f2;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.4;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button:hover .account-badge {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Responsividade para o badge */
@media (max-width: 768px) {
    .account-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
        margin-left: 4px;
    }
    
    .link-button {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
} 