/* MeshAds Product Performance Styles */
.product-performance-section {
    margin-top: 20px;
}

.performance-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 15px auto;
    max-width: 1000px;
    justify-content: center;
}

.performance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 14px;
    color: white;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 80px;
}

.performance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.performance-card-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.performance-card-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-metric {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Performance Table Styles */
.product-performance-table-container {
    margin: 20px 0;
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.product-performance-table-container h4 {
    margin: 0 0 15px 0;
    color: var(--input-text);
    font-weight: 600;
}

.performance-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--input-text);
    background: var(--input-bg);
    border-radius: 8px 8px 0 0;
    margin-bottom: 5px;
}

.table-cell {
    padding: 6px 8px;
    text-align: left;
    font-size: 12px;
}

.table-cell.sortable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.table-cell.sortable:hover {
    background-color: var(--hover-bg);
}

.table-header .table-cell {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.performance-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background-color 0.2s ease;
}

.performance-row:hover {
    background-color: rgba(18, 158, 217, 0.05);
}

.performance-row .table-cell {
    display: flex;
    align-items: center;
}

.product-title {
    font-weight: 500;
    color: var(--input-text);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Performance Status Styles */
.performance-status {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-excellent {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.status-good {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.status-break-even {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
}

.status-losing-money {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

.status-no-conversions {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.status-needs-attention {
    background: rgba(158, 158, 158, 0.1);
    color: #9E9E9E;
}

/* Range Buttons */
.range-buttons-campaigns {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.range-buttons-campaigns button {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.range-buttons-campaigns button:hover {
    background-color: #f0f0f0;
    border-color: #129ed9;
}

.range-buttons-campaigns button.active {
    background-color: #129ed9;
    border-color: #129ed9;
    color: white;
}

/* Performance Insights */
.performance-insights {
    margin: 30px 0;
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.performance-insights h4 {
    margin: 0 0 15px 0;
    color: var(--input-text);
    font-weight: 600;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: var(--input-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.insight-item i {
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.insight-item span {
    color: var(--input-text);
    line-height: 1.4;
    font-size: 14px;
}

.insight-item.warning {
    border-left-color: #FFC107;
}

.insight-item.warning i {
    color: #FFC107;
}

.insight-item.success {
    border-left-color: #4CAF50;
}

.insight-item.success i {
    color: #4CAF50;
}

.metric-highlight {
    font-weight: 600;
    color: var(--primary-color);
}

/* Mobile Responsiveness for MeshAds */
@media (max-width: 768px) {
    .performance-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 10px auto;
        max-width: 600px;
    }

    .performance-card {
        padding: 12px;
        min-height: 70px;
    }

    .performance-card-title {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .product-name {
        font-size: 11px;
        line-height: 1.1;
    }

    .performance-metric {
        font-size: 14px;
    }

    /* Make table more compact on mobile */
    .table-header {
        grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr;
        gap: 4px;
        padding: 8px 0;
    }

    .performance-row {
        grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr;
        gap: 4px;
        padding: 8px 0;
    }

    .table-cell {
        padding: 4px 6px;
        font-size: 11px;
    }

    .table-header .table-cell {
        font-size: 10px;
    }

    .product-title {
        max-width: 120px;
        font-size: 11px;
    }

    .performance-status {
        padding: 3px 6px;
        font-size: 9px;
    }

    /* MeshAds general mobile styles */
    #campaignsInterface {
        padding: 10px;
    }

    .feed-nav-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .range-buttons-campaigns {
        flex-wrap: wrap;
        gap: 6px;
        margin: 10px 0;
    }

    .range-buttons-campaigns button {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 15px;
    }

    .campaign-select-container {
        margin-bottom: 15px;
    }

    .campaign-select-container select {
        width: 100%;
        font-size: 14px;
    }

    /* Insights performance cards mobile */
    .insights-performance-section .performance-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* Product performance insights mobile */
    .performance-insights {
        padding: 15px;
        margin: 15px 0;
    }

    .insight-item {
        font-size: 13px;
        padding: 10px;
    }

    /* Hide some columns on very small screens */
    @media (max-width: 480px) {
        .table-header {
            grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr;
        }

        .performance-row {
            grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1fr;
        }

        /* Hide conversion value and ROAS columns on very small screens */
        .table-header .table-cell:nth-child(7),
        .table-header .table-cell:nth-child(8),
        .performance-row .table-cell:nth-child(7),
        .performance-row .table-cell:nth-child(8) {
            display: none;
        }

        .range-buttons-campaigns button:nth-child(2) {
            display: none; /* Hide Yesterday button */
        }

        /* Stack nav cards vertically on very small screens */
        .feed-nav-cards {
            grid-template-columns: 1fr;
        }

        /* Make performance section more compact */
        .product-performance-section h3 {
            font-size: 16px;
            margin: 10px 0;
        }
    }
} 